annotate mm7_4.cpp @ 25:2bbf33898c6b

c/p error in prev commit
author Nomad
date Mon, 15 Oct 2012 18:45:11 +0200
parents 74940016abc8
children 93bf1d5f6a6d
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include <io.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include <direct.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "MapInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "GUIWindow.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "GUIButton.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "GUIFont.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "AudioPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "Outdoor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 #include "IndoorCamera.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 #include "Overlays.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 #include "Monsters.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 #include "Arcomage.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 #include "Actor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 #include "Allocator.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 #include "Events.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 #include "Viewport.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 #include "FrameTableInc.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 #include "Math.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 #include "LayingItem.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 #include "ObjectList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 #include "Chest.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 #include "PaletteManager.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 #include "DecorationList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 #include "SaveLoad.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 #include "stru123.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 #include "stru287.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 #include "Time.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 #include "IconFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 #include "GUIProgressBar.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 #include "stru157.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 #include "Bink_Smacker.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 #include "TileFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 #include "PlayerFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 #include "Awards.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 #include "Autonotes.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 #include "stru160.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 #include "stru279.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 #include "TurnEngine.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 #include "FactionTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 #include "StorylineTextTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 #include "Random.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 #include "stru277.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 #include "stru298.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 #include "stru12.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 #include "stru351.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 #include "Events2D.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 #include "stru159.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 #include "Log.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 //----- (0046CC4B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 void __cdecl _46CC4B_check_event_triggers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 LevelDecoration *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 signed int v2; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 int v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 int v4; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 unsigned int v6; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 unsigned int v7; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 unsigned int v8; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 char *v9; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 int v11; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 int v12; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 unsigned int v13; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 int v14; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 unsigned int v15; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 unsigned int v16; // edx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 char *v17; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 int v18; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 int v19; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 int v20; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 unsigned int v21; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 int v22; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 unsigned int v23; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 unsigned int v24; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 int v25; // [sp+0h] [bp-24h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 int v26; // [sp+0h] [bp-24h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 int v27; // [sp+0h] [bp-24h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 int v28; // [sp+4h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 int v29; // [sp+4h] [bp-20h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 int v30; // [sp+4h] [bp-20h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 signed int v31; // [sp+8h] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 int v32; // [sp+Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 int v33; // [sp+10h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 int i; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 int v35; // [sp+18h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 int v36; // [sp+1Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 signed int v37; // [sp+1Ch] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 signed int v38; // [sp+20h] [bp-4h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 for ( i = 0; i < _6836C8_num_decorations_6807E8; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 v1 = &pLevelDecorations[_6807E8_level_decorations_ids[v0]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 v2 = v1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 v3 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 v33 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 v32 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 v35 = v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 v31 = v1->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 if ( v1->field_2 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 v36 = abs(v1->vPosition.x - pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 v25 = abs(v3 - pParty->vPosition.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 v28 = abs(v35 - pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 v4 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 v5 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 v6 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 if ( v36 < v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 v4 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 v5 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 if ( v4 < v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 v7 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 v4 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 v6 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 if ( v5 < (signed int)v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 v8 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 v5 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 if ( (signed int)(((unsigned int)(11 * v5) >> 5) + (v6 >> 2) + v4) < v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 EventProcessor(v1->field_16_event_id, 8 * i | 5, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 if ( v1->field_2 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 v9 = (char *)&pActors[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 v10 = abs(v33 - *((short *)v9 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 v29 = abs(v32 - *(short *)v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 v26 = abs(v35 - *((short *)v9 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 v12 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 v13 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 if ( v11 < v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 v14 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 v11 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 v12 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 if ( v11 < v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 v15 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 v11 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 v13 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 if ( v12 < (signed int)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 v16 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 v12 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 if ( (signed int)(((unsigned int)(11 * v12) >> 5) + (v13 >> 2) + v11) < v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 EventProcessor(v1->field_16_event_id, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 v9 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 while ( v37 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 if ( v1->field_2 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 v17 = (char *)&pLayingItems[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 v18 = abs(v33 - *((int *)v17 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 v30 = abs(v32 - *(int *)v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 v27 = abs(v35 - *((int *)v17 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 v19 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 v20 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 v21 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 if ( v19 < v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 v22 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 v19 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 v20 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 if ( v19 < v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 v23 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 v19 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 v21 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 if ( v20 < (signed int)v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 v24 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 v20 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 if ( (signed int)(((unsigned int)(11 * v20) >> 5) + (v21 >> 2) + v19) < v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 EventProcessor(v1->field_16_event_id, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 v17 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 while ( v38 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 v0 = i + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 //----- (0046CEC3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 int __fastcall _46CEC3_get_floor_level(signed int a1, signed int a2, int a3, unsigned int uSectorID, int *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 BLVSector *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 Vec3_short_ *v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 BLVFace *v8; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 int v9; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 int v10; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 int v11; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 int v13; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 signed int v14; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 int v15; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 int v16; // edx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 int v17; // ST18_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 signed int v18; // edx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 signed __int64 v19; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 PolygonType v20; // al@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 int v21; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 int v22; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 BLVFace *v23; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 int v24; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 int v25; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 int v26; // esi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 int v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 signed int v28; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 int v29; // ebx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 int v30; // edx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 int v31; // ST10_4@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 signed int v32; // edx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 signed __int64 v33; // qtt@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 signed int v34; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 signed int v35; // esi@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 int result; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 int v37; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 int v38; // edx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 int v39; // [sp+Ch] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 int v40; // [sp+10h] [bp-30h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 int v41; // [sp+14h] [bp-2Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 unsigned __int16 *v42; // [sp+18h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 BLVSector *v43; // [sp+1Ch] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 int v44; // [sp+20h] [bp-20h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 int v45; // [sp+24h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 signed int v46; // [sp+24h] [bp-1Ch]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 bool v47; // [sp+24h] [bp-1Ch]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 bool v48; // [sp+28h] [bp-18h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 bool v49; // [sp+28h] [bp-18h]@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 bool v50; // [sp+2Ch] [bp-14h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 int v51; // [sp+2Ch] [bp-14h]@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 signed int v52; // [sp+30h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 signed int v53; // [sp+30h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 signed int v54; // [sp+30h] [bp-10h]@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 signed int v55; // [sp+34h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 signed int v56; // [sp+38h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 signed int v57; // [sp+3Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 int uSectorIDa; // [sp+4Ch] [bp+Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 signed int uSectorIDb; // [sp+4Ch] [bp+Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 v5 = &pIndoor->pSectors[uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 v57 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 v56 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 v43 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 v42 = v5->pFloors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 v7 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 v39 = v5->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 for ( uSectorIDa = 0; uSectorIDa < v39; ++uSectorIDa )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 v40 = (int)&v42[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 v8 = &pIndoor->pFaces[*(short *)v40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 if ( !(BYTE3(v8->uAttributes) & 0x20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 && v56 <= v8->pBounding.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 && v56 >= v8->pBounding.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 && v57 <= v8->pBounding.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 && v57 >= v8->pBounding.y1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 if ( v8->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 v9 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 v10 = 2 * v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 word_721460[2 * v52] = v8->pXInterceptDisplacements[v52] + v7[v8->pVertexIDs[v52]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 word_721390[2 * v52] = v8->pYInterceptDisplacements[v9] + v7[v8->pVertexIDs[v9]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 word_721460[2 * v52++ + 1] = v8->pXInterceptDisplacements[v9] + v7[v8->pVertexIDs[v9 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 word_721390[v10 + 1] = v8->pYInterceptDisplacements[v9] + v7[v8->pVertexIDs[v9 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 while ( v52 < v8->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 v5 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 v44 = 2 * v8->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 v11 = 2 * v8->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 word_721460[v11] = word_721460[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 word_721390[v11] = word_721390[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 v48 = word_721390[0] >= v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 if ( v44 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 if ( v53 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 v41 = word_721390[v12 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 v50 = word_721390[v12 + 1] >= v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 if ( v48 == v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 v13 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 v13 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 if ( word_721460[v45 + 1] >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 v14 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 v15 = v14 | word_721460[v45] < v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 if ( v15 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 if ( !v15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 || (v16 = word_721390[v45],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 v17 = v41 - v16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 v18 = v57 - v16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 LODWORD(v19) = v18 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 HIDWORD(v19) = v18 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 v7 = pIndoor->pVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 (signed int)(((unsigned __int64)(((signed int)word_721460[v45 + 1] - (signed int)word_721460[v45])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 * v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 / v17) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 + word_721460[v45]) >= v56) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 v12 = v13 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 v48 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 v45 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 while ( v12 < v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 if ( v53 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 if ( v55 >= 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 v20 = v8->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 if ( v20 == 3 || v20 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 v21 = v7[*v8->pVertexIDs].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 v7 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 v21 = ((unsigned __int64)(v8->zCalc1 * (signed __int64)v56) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 + ((unsigned __int64)(v8->zCalc2 * (signed __int64)v57) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 + HIWORD(v8->zCalc3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 v22 = v55++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 dword_7212C8[v22] = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 dword_721200[v22] = *(short *)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 v6 = uSectorIDa + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 if ( v5->field_0 & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 for ( uSectorIDb = 0; uSectorIDb < v5->uNumPortals; ++uSectorIDb )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 v23 = &pIndoor->pFaces[v5->pPortals[uSectorIDb]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 if ( v23->uPolygonType == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 && v56 <= v23->pBounding.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 && v56 >= v23->pBounding.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 && v57 <= v23->pBounding.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 && v57 >= v23->pBounding.y1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 if ( v23->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 v24 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 v25 = 2 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 word_721460[2 * v46] = v23->pXInterceptDisplacements[v46] + v7[v23->pVertexIDs[v46]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 word_721390[2 * v46] = v23->pYInterceptDisplacements[v24] + v7[v23->pVertexIDs[v24]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 word_721460[2 * v46++ + 1] = v23->pXInterceptDisplacements[v24 + 1] + v7[v23->pVertexIDs[v24 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 word_721390[v25 + 1] = v23->pYInterceptDisplacements[v24 + 1] + v7[v23->pVertexIDs[v24 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 while ( v46 < v23->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 v5 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 v26 = 2 * v23->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 word_721460[2 * v23->uNumVertices] = word_721460[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 word_721390[v26] = word_721390[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 v49 = word_721390[0] >= v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 if ( v26 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 if ( v54 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 v27 = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 v47 = word_721390[v51 + 1] >= v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 if ( v49 != v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 if ( word_721460[v27 + 1] >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 v28 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 v29 = v28 | word_721460[v27] < v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 if ( v29 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 if ( !v29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 || (v30 = word_721390[v27],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 v31 = word_721390[v51 + 1] - v30,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 v32 = v57 - v30,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 LODWORD(v33) = v32 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 HIDWORD(v33) = v32 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 v7 = pIndoor->pVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 (signed int)(((unsigned __int64)(((signed int)word_721460[v27 + 1] - (signed int)word_721460[v27])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 * v33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 / v31) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 + word_721460[v27]) >= v56) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 ++v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 ++v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 v49 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 while ( v51 < v26 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 if ( v54 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 if ( v55 >= 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 v34 = v55++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 dword_7212C8[v34] = -29000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 dword_721200[v34] = v5->pPortals[uSectorIDb];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 if ( v55 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 *a5 = dword_721200[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 return dword_7212C8[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 if ( !v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 return -30000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 *a5 = dword_721200[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 result = dword_7212C8[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 if ( v55 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 v37 = a3 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 v38 = dword_7212C8[v35];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 if ( result <= v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 if ( v38 < result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 goto LABEL_67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 LABEL_68:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 ++v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 if ( v35 >= v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 if ( v38 <= result || v38 > v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 goto LABEL_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 LABEL_67:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 result = dword_7212C8[v35];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 *a5 = dword_721200[v35];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 goto LABEL_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 //----- (0046D49E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 int __fastcall sub_46D49E_prolly_get_world_y_under_party(int a1, signed int a2, int a3, int a4, int *a5, int *a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 signed int v7; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 BSPModel *v10; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 ODMFace *v11; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 unsigned __int8 v12; // al@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 char *v13; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 int v14; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 int v15; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 int v16; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 int v17; // edi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 signed int v18; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 int v19; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 int v20; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 int v21; // ST1C_4@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 signed int v22; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 signed __int64 v23; // qtt@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 int v24; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 signed int v25; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 int result; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 signed int v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 int v28; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 signed int v29; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 int v30; // esi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 int v31; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 ODMFace *v32; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 int v33; // ecx@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 int v34; // [sp+Ch] [bp-34h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 int v35; // [sp+10h] [bp-30h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 int v36; // [sp+14h] [bp-2Ch]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 int v37; // [sp+18h] [bp-28h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 int v38; // [sp+1Ch] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 int v39; // [sp+20h] [bp-20h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 int v40; // [sp+24h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 signed int v41; // [sp+28h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 int v42; // [sp+2Ch] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 bool v43; // [sp+30h] [bp-10h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 bool v44; // [sp+34h] [bp-Ch]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 signed int v45; // [sp+38h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 signed int v46; // [sp+3Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 signed int v47; // [sp+58h] [bp+18h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 signed int v48; // [sp+58h] [bp+18h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 signed int v49; // [sp+58h] [bp+18h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 v8 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 v45 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 v40 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 v46 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 v9 = GetTerrainHeightsAroundParty2(a1, a2, a5, a7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 dword_721160[0] = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 dword_721110[0] = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 dword_7211B0[0] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 if ( (signed int)pOutdoor->uNumBModels <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 v10 = &pOutdoor->pBModels[v38];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 if ( v8 <= pOutdoor->pBModels[v38].sMaxX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 if ( v8 >= v10->sMinX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 if ( v7 <= v10->sMaxY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 if ( v7 >= v10->sMinY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 v42 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 v34 = v10->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 if ( (signed int)v10->uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 v11 = &v10->pFaces[v39];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 v12 = v11->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 if ( (v12 == 3 || v12 == 4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 && !(BYTE3(v11->uFaceAttributes) & 0x20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 && v8 <= v11->pBoundingBox.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 && v8 >= v11->pBoundingBox.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 && v7 <= v11->pBoundingBox.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 && v7 >= v11->pBoundingBox.y1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 if ( v11->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 v13 = (char *)v11->pXInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 v14 = 2 * v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 word_721040[2 * v47] = *(short *)v13 + LOWORD(v10->pVertices.pVertices[*((short *)v13 - 60)].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 word_720F70[2 * v47] = *((short *)v13 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 + LOWORD(v10->pVertices.pVertices[*((short *)v13 - 60)].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 word_721040[2 * v47++ + 1] = *(short *)v13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 + LOWORD(v10->pVertices.pVertices[*((short *)v13 - 59)].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 word_720F70[v14 + 1] = *((short *)v13 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 + LOWORD(v10->pVertices.pVertices[*((short *)v13 - 59)].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 v13 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 while ( v47 < v11->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 v8 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 v15 = 2 * v11->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 word_721040[2 * v11->uNumVertices] = word_721040[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 word_720F70[v15] = word_720F70[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 v35 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 v43 = word_720F70[0] >= v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 if ( v48 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 v17 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 v8 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 v36 = word_720F70[v16 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 v44 = word_720F70[v16 + 1] >= v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 if ( v43 != v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 v18 = word_721040[v17 + 1] >= v40 ? 0 : 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 v19 = v18 | word_721040[v17] < v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 if ( v19 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 if ( !v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 || (v20 = word_720F70[v17],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 v21 = v36 - v20,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 v22 = v45 - v20,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 LODWORD(v23) = v22 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 HIDWORD(v23) = v22 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 (signed int)(((unsigned __int64)(((signed int)word_721040[v17 + 1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 - (signed int)word_721040[v17])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 * v23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 / v21) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 + word_721040[v17]) >= v40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 v16 = v37 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 v43 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 while ( v37 < v35 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 if ( v48 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 if ( v46 >= 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 if ( v11->uPolygonType == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 v24 = v10->pVertices.pVertices[v11->pVertexIDs[0]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 v24 = ((unsigned __int64)(v11->zCalc1 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 + ((unsigned __int64)(v11->zCalc2 * (signed __int64)v45) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 + HIWORD(v11->zCalc3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 v25 = v46++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 dword_7211B0[v25] = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 dword_721160[v25] = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 dword_721110[v25] = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 ++v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 if ( v42 >= v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 v7 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 if ( v41 >= (signed int)pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 v7 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 if ( v46 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 *a6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 return dword_7211B0[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 if ( v46 <= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 *a6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 v30 = dword_7211B0[v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 v31 = *(int *)((char *)dword_7211B0 + v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 if ( v30 == v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 if ( v31 > a3 + 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 if ( v30 >= v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 v27 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 v28 = v29 * 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 if ( v30 > v31 && v30 <= a3 + 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 LABEL_52:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 while ( v49 < v46 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 if ( !v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 *a6 = dword_721110[v27] | (dword_721160[v27] << 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 v32 = &pOutdoor->pBModels[dword_721160[v27]].pFaces[dword_721110[v27]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 *a5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 if ( v32->uFaceAttributes & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 *a5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 v33 = dword_7211B0[v27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 result = dword_7211B0[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 if ( v33 >= dword_7211B0[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 result = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 //----- (0046D8E3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 int __fastcall sub_46D8E3(int a1, signed int a2, int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 unsigned int v5; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 BSPModel *v6; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 ODMFace *v7; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 unsigned __int8 v8; // al@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 unsigned __int16 *v9; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 int v10; // edx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 int v11; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 int v12; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 signed int v13; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 int v14; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 int v15; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 int v16; // ST18_4@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 signed int v17; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 signed __int64 v18; // qtt@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 int v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 signed int v20; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 signed int v22; // ebx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 unsigned int v23; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 int v24; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 int v25; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 int v26; // [sp+Ch] [bp-38h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 int v27; // [sp+10h] [bp-34h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 int v28; // [sp+18h] [bp-2Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 int v29; // [sp+1Ch] [bp-28h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 unsigned int v30; // [sp+20h] [bp-24h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 signed int v31; // [sp+24h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 signed int v32; // [sp+28h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 int v33; // [sp+2Ch] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 bool v34; // [sp+30h] [bp-14h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 bool v35; // [sp+34h] [bp-10h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 signed int v36; // [sp+38h] [bp-Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 signed int v37; // [sp+38h] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 signed int v38; // [sp+38h] [bp-Ch]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 signed int v39; // [sp+3Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 signed int v40; // [sp+40h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 dword_720ED0[0] = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 dword_720E80[0] = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 v31 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 v39 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 dword_720F20[0] = 10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 v6 = &pOutdoor->pBModels[v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 if ( v4 <= pOutdoor->pBModels[v29].sMaxX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 if ( v4 >= v6->sMinX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 if ( v40 <= v6->sMaxY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 if ( v40 >= v6->sMinY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 v33 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 v26 = v6->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 if ( (signed int)v6->uNumFaces > (signed int)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 v30 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 v7 = (ODMFace *)((char *)v6->pFaces + v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 v8 = v7->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 if ( (v8 == 5 || v8 == 6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 && !(BYTE3(v7->uFaceAttributes) & 0x20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 && v4 <= v7->pBoundingBox.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 && v4 >= v7->pBoundingBox.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 && v40 <= v7->pBoundingBox.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 && v40 >= v7->pBoundingBox.y1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 v36 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 if ( v7->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 v9 = v7->pXInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 v10 = 2 * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 word_720DB0_xs[2 * v36] = *v9 + LOWORD(v6->pVertices.pVertices[*(v9 - 60)].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 word_720CE0_ys[2 * v36] = v9[20] + LOWORD(v6->pVertices.pVertices[*(v9 - 60)].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 word_720DB0_xs[2 * v36++ + 1] = *v9 + LOWORD(v6->pVertices.pVertices[*(v9 - 59)].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 word_720CE0_ys[v10 + 1] = v9[20] + LOWORD(v6->pVertices.pVertices[*(v9 - 59)].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 while ( v36 < v7->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 v4 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 v27 = 2 * v7->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 word_720DB0_xs[2 * v7->uNumVertices] = word_720DB0_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 word_720CE0_ys[v27] = word_720CE0_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 v34 = word_720CE0_ys[0] >= v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 if ( v37 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 v4 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 v35 = word_720CE0_ys[v12 + 1] >= v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 if ( v34 != v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 v13 = word_720DB0_xs[v12 + 1] >= v31 ? 0 : 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 v14 = v13 | word_720DB0_xs[v12] < v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 if ( v14 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 if ( !v14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 || (v15 = word_720CE0_ys[v12],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 v16 = word_720CE0_ys[v12 + 1] - v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 v17 = v40 - v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 LODWORD(v18) = v17 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 HIDWORD(v18) = v17 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 (signed int)(((unsigned __int64)(((signed int)word_720DB0_xs[v12 + 1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 - (signed int)word_720DB0_xs[v12])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 * v18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 / v16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 + word_720DB0_xs[v12]) >= v31) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 v11 = v28 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 v34 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 while ( v28 < v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 if ( v39 >= 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 if ( v7->uPolygonType == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 v19 = v6->pVertices.pVertices[v7->pVertexIDs[0]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 v19 = ((unsigned __int64)(v7->zCalc1 * (signed __int64)v4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 + ((unsigned __int64)(v7->zCalc2 * (signed __int64)v40) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 + HIWORD(v7->zCalc3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 v20 = v39++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 dword_720F20[v20] = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 dword_720ED0[v20] = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 dword_720E80[v20] = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 v30 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 if ( v33 >= v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 ++v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 while ( v32 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 if ( !v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926 *(int *)a4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 return dword_720F20[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 v38 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 if ( v39 <= (signed int)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 v24 = dword_720F20[v5 / 4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 v25 = *(int *)((char *)dword_720F20 + v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 if ( v24 == v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 if ( v25 > a3 + 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 if ( v24 >= v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 v22 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 v23 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 if ( v24 > v25 && v24 <= a3 + 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 v5 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 while ( v38 < v39 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 *(int *)a4 = dword_720E80[v22] | (dword_720ED0[v22] << 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 return dword_720F20[v22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 *(int *)a4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 return dword_720F20[v22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 //----- (0046DCC8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 signed __int64 __fastcall _46DCC8_get_gravity_direction_outdoor(int a1, int a2, Vec3_int_ *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 int v4; // ST4C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 unsigned int v5; // ST54_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 unsigned int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 unsigned int v7; // ST50_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 int v9; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 int v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 int v11; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 int v12; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 int v13; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 int v14; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 double v15; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 double v16; // st6@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 double v17; // st5@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 float v18; // ST44_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 float v19; // ST54_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 double v20; // st4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 double v21; // st5@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 float v22; // ST44_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 double v23; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 double v24; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 signed __int64 result; // qax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 int v26; // [sp+14h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 int v27; // [sp+18h] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 int v28; // [sp+20h] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 int v29; // [sp+24h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 int v30; // [sp+28h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 int v31; // [sp+2Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 int v32; // [sp+30h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 int v33; // [sp+34h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 int v34; // [sp+38h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 int v35; // [sp+3Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 int v36; // [sp+40h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 int v37; // [sp+4Ch] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 float v38; // [sp+4Ch] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 int v39; // [sp+50h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 float v40; // [sp+50h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 int v41; // [sp+54h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 v5 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 v6 = WorldPosToGridCellZ(v4) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 v33 = GridCellToWorldPosX(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 v34 = GridCellToWorldPosX(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 v35 = GridCellToWorldPosX(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 v36 = GridCellToWorldPosX(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 v29 = GridCellToWorldPosZ(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 v30 = GridCellToWorldPosZ(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 v7 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 v31 = GridCellToWorldPosZ(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 v32 = GridCellToWorldPosZ(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 v26 = pOutdoor->DoGetHeightOnTerrain(v5, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 v27 = pOutdoor->DoGetHeightOnTerrain(v5 + 1, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 v8 = pOutdoor->DoGetHeightOnTerrain(v5 + 1, v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 v28 = pOutdoor->DoGetHeightOnTerrain(v5, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 v9 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 v10 = abs(v3 - v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 if ( abs(v29 - v4) >= v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 v11 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 v37 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 v39 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 v12 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 v13 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 v14 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 v8 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 v11 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 v41 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 v39 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 v12 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 v13 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 v9 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 v37 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 v14 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 v15 = (double)(v12 - v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 v16 = (double)(v13 - v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 v17 = (double)(v14 - v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 v18 = (double)(v11 - v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 v19 = (double)(v9 - v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 v20 = (double)(v8 - v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 v38 = v20 * v16 - v19 * v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 v40 = v18 * v17 - v20 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 v21 = v19 * v15 - v18 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 v23 = sqrt(v21 * v21 + v40 * v40 + v38 * v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 if ( v23 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 a3->y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 a3->x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 a3->z = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 v24 = 1.0 / v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 a3->x = (signed __int64)(v24 * v38 * 65536.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 a3->y = (signed __int64)(v24 * v40 * 65536.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 v22 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 result = (signed __int64)(v24 * v22 * 65536.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 a3->z = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 // 47F469: using guessed type int __stdcall GridCellToWorldPosX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 // 47F476: using guessed type int __stdcall GridCellToWorldPosZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 //----- (0046DEF2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 result = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 if ( pObjectList->pObjects[pLayingItems[uLayingItemID].uObjectDescID].uFlags & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 result = _46BFFA_check_object_intercept(uLayingItemID, a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 //----- (0046DF1A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 signed int __fastcall _46DF1A_collide_against_actor(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 Actor *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 unsigned __int16 v3; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 int v4; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 int v5; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 int v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 int v7; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 int v8; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 int v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 int v11; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 int v12; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 int v13; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 unsigned int v14; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 signed int result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 int v16; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 int v17; // [sp+10h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 int v18; // [sp+14h] [bp-8h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 int v19; // [sp+18h] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 v16 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 v2 = &pActors[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 v3 = v2->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 if ( v3 == 11 || v3 == 4 || v3 == 19 || v3 == 5 || v3 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 v4 = v2->uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 v5 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 if ( stru_721530.sMaxX > v5 + v4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 || stru_721530.sMinX < v5 - v4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 || (v6 = v2->vPosition.y, stru_721530.sMaxY > v6 + v4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 || stru_721530.sMinY < v6 - v4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 || (v7 = v2->vPosition.z, stru_721530.sMaxZ > v7 + v2->uActorHeight)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 || stru_721530.sMinZ < v7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 || (v8 = v5 - stru_721530.normal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 v9 = v6 - stru_721530.normal.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 v10 = stru_721530.prolly_normal_d + v4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 v17 = stru_721530.prolly_normal_d + v4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 v11 = (v8 * stru_721530.field_58.y - v9 * stru_721530.field_58.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 v18 = v8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 v19 = v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 abs((v8 * stru_721530.field_58.y - v9 * stru_721530.field_58.x) >> 16) > v10)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 || (v12 = (v18 * stru_721530.field_58.x + v19 * stru_721530.field_58.y) >> 16, v12 <= 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 || (signed int)(((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v12) >> 16) + stru_721530.normal.z) < v2->vPosition.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 v13 = v12 - sub_452A9E(v17 * v17 - v11 * v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 if ( v13 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 if ( v13 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 stru_721530.field_7C = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 v14 = 8 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 LOBYTE(v14) = 8 * v16 | 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 stru_721530.uFaceID = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 //----- (0046E0B2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 void __cdecl _46E0B2_collide_against_decorations()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 BLVSector *v0; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 LevelDecoration *v1; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 DecorationDesc *v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 int v3; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 int v5; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 int v6; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 int v7; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 int v8; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 int v9; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 int v10; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 int v11; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 int v12; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 unsigned int v13; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 signed int i; // [sp+4h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 int v15; // [sp+8h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 int v16; // [sp+Ch] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 int v17; // [sp+10h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 int v18; // [sp+14h] [bp-4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 v0 = &pIndoor->pSectors[stru_721530.uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 for ( i = 0; i < v0->uNumDecorations; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 v1 = &pLevelDecorations[v0->pDecorationIDs[i]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 if ( !(v1->field_2 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 v2 = &pDecorationList->pDecorations[v1->uDecorationDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 if ( !(v2->uFlags & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 v3 = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 v4 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 if ( stru_721530.sMaxX <= v4 + v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 if ( stru_721530.sMinX >= v4 - v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 v5 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 if ( stru_721530.sMaxY <= v5 + v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201 if ( stru_721530.sMinY >= v5 - v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 v6 = v2->uDecorationHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 v7 = v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 v18 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 if ( stru_721530.sMaxZ <= v7 + v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 if ( stru_721530.sMinZ >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 v16 = v4 - stru_721530.normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 v15 = v5 - stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 v8 = stru_721530.prolly_normal_d + v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 v17 = ((v4 - stru_721530.normal.x) * stru_721530.field_58.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 - (v5 - stru_721530.normal.y) * stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 if ( abs(v17) <= stru_721530.prolly_normal_d + v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 v9 = (v16 * stru_721530.field_58.x + v15 * stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 if ( v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 v10 = v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 v11 = stru_721530.normal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 + ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v9) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 if ( v11 >= v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 if ( v11 <= v18 + v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 v12 = v9 - sub_452A9E(v8 * v8 - v17 * v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 if ( v12 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 if ( v12 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 stru_721530.field_7C = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 v13 = 8 * v0->pDecorationIDs[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 LOBYTE(v13) = v13 | 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 stru_721530.uFaceID = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 //----- (0046E26D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 void __fastcall _46E26D_collide_against_sprites(signed int a1, signed int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 int v2; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 unsigned __int16 *v3; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 unsigned __int16 v4; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 LevelDecoration *v5; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 DecorationDesc *v6; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 int v8; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 int v9; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 int v10; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 int v11; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 int v12; // ebp@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 int v13; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 int v14; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 int v15; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269 int v16; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 int v17; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 char v18; // zf@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 int v19; // [sp+0h] [bp-10h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 unsigned __int16 *v20; // [sp+4h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 int v21; // [sp+8h] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 int v22; // [sp+Ch] [bp-4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 if ( a1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 if ( a1 <= 127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 if ( a2 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 if ( a2 <= 127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 v2 = a1 + (a2 << 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 v3 = &pOutdoor->pFaceIDLIST[pOutdoor->pOMAP[v2]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 v20 = &pOutdoor->pFaceIDLIST[pOutdoor->pOMAP[v2]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 v4 = *v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 if ( (v4 & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 v5 = &pLevelDecorations[(signed __int16)v4 >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 if ( !(v5->field_2 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 v6 = &pDecorationList->pDecorations[v5->uDecorationDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 if ( !(v6->uFlags & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 v7 = v6->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 v8 = v5->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 if ( stru_721530.sMaxX <= v8 + v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 if ( stru_721530.sMinX >= v8 - v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 v9 = v5->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 if ( stru_721530.sMaxY <= v9 + v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 if ( stru_721530.sMinY >= v9 - v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 v10 = v6->uDecorationHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 v11 = v5->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 v22 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 if ( stru_721530.sMaxZ <= v11 + v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 if ( stru_721530.sMinZ >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 v12 = v8 - stru_721530.normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 v19 = v9 - stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 v13 = stru_721530.prolly_normal_d + v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 v21 = ((v8 - stru_721530.normal.x) * stru_721530.field_58.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 - (v9 - stru_721530.normal.y) * stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 if ( abs(v21) <= stru_721530.prolly_normal_d + v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 v14 = (v12 * stru_721530.field_58.x + v19 * stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 if ( v14 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 v15 = v5->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 v16 = stru_721530.normal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 + ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 if ( v16 >= v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 if ( v16 <= v22 + v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 v17 = v14 - sub_452A9E(v13 * v13 - v21 * v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 if ( v17 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 if ( v17 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 stru_721530.field_7C = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 stru_721530.uFaceID = (signed __int16)*v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 v3 = v20 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 v18 = *v20 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 while ( !v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 //----- (00486F92) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 void __cdecl sr_sub_486F92_MessWithEdgesAndSpans()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 Span *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 Edge *v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 Edge *v3; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 Edge *v4; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 Edge *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 Edge *v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 Surf *v7; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 double v8; // st7@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 Surf *v9; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 double v10; // st6@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 double v11; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 signed __int64 v12; // qax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 stru148 *v13; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 Span *v14; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 double v15; // st7@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 signed __int64 v16; // qax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 stru148 *v17; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 Span *v18; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 Edge *i; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 Edge *v20; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 Edge *v21; // esi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 double v22; // st7@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 Edge *v23; // edx@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 unsigned int v24; // [sp+10h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 float v25; // [sp+14h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 Edge *v26; // [sp+18h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 unsigned int v27; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 v0 = pSpans;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 stru_80C9D8.pSurf = &stru_80C980;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 stru_80C9D8.field_0 = (double)(signed int)pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 stru_80C9A4.pSurf = &stru_80C980;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 stru_80C980.pPrev = &stru_80C980;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 stru_80C980.pNext = &stru_80C980;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 stru_80C9A4.field_0 = (double)(signed int)pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 stru_80C980.field_8 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 stru_80C980.field_4 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 stru_80C9D8.pNext = &stru_80C9A4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 stru_80C9D8.pPrev = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 stru_80C9D8.field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 stru_80C9A4.pNext = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 stru_80C9A4.pPrev = &stru_80C9D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 stru_80C9A4.field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 LODWORD(stru_80C980.field_0) = 0xC97423F0u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 v27 = pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 if ( (signed int)pViewport->uViewportY > (signed int)pViewport->uViewportW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 v0->field_8 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 v1 = 52 * pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 v24 = 52 * pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 v2 = *(Edge **)((char *)&pNewEdges->pNext + v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 v3 = &stru_80C9D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 v25 = (double)(signed int)v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 if ( v2 != &defaultEdge )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 v4 = v3->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 if ( v2->field_0 <= (double)v4->field_0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 v3 = v3->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 v5 = v2->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 v2->pNext = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 v2->pPrev = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 v3->pNext->pPrev = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 v3->pNext = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 v2 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 while ( v5 != &defaultEdge );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 v6 = stru_80C9D8.pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 stru_80C980.field_20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 stru_80C980.field_22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 v26 = stru_80C9D8.pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 if ( stru_80C9D8.pNext )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 v7 = v6->pSurf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 if ( v6->field_8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 ++v7->field_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 if ( v7->field_22 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 v8 = v6->field_0 + 2.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 v9 = stru_80C980.pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 v10 = (v8 - v7->field_C) * v7->field_4 + (v25 - v7->field_10) * v7->field_8 + v7->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 if ( v10 <= (v8 - stru_80C980.pNext->field_C) * stru_80C980.pNext->field_4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 + (v25 - stru_80C980.pNext->field_10) * stru_80C980.pNext->field_8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 + stru_80C980.pNext->field_0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 v9 = v9->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 while ( v10 <= (v8 - v9->field_C) * v9->field_4 + (v25 - v9->field_10) * v9->field_8 + v9->field_0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 v7->pNext = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 v7->pPrev = v9->pPrev;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 v9->pPrev->pNext = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 v9->pPrev = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 v11 = v6->field_0 + 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 v12 = (signed __int64)(v11 - (double)stru_80C980.pNext->field_20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 v0->field_C = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 if ( (signed __int16)v12 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 v0->field_A = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 v0->field_8 = v9->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 v13 = v9->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 v0->pParent = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 if ( v13->prolly_head )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 v14 = v13->prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 v14->pNext = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 v13->prolly_head = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 v13->prolly_tail = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 if ( (signed int)pOutdoorCamera->uNumSpans >= 12499 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 ++pOutdoorCamera->uNumSpans;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 v6 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 v7->field_20 = (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 v7->pNext = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 v9->pPrev = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 stru_80C980.pNext = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 v7->pPrev = &stru_80C980;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 --v7->field_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 if ( !v7->field_22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 if ( stru_80C980.pNext == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 v15 = v6->field_0 + 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 v16 = (signed __int64)(v15 - (double)v7->field_20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 v0->field_C = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 if ( (signed __int16)v16 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 v0->field_A = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 v0->field_8 = v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 v17 = v7->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 v0->pParent = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 if ( v17->prolly_head )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 v18 = v17->prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 v18->pNext = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 v17->prolly_head = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 v17->prolly_tail = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 if ( (signed int)pOutdoorCamera->uNumSpans >= 12499 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 ++pOutdoorCamera->uNumSpans;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 v7->pNext->field_20 = (signed __int64)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 v6 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 v7->pNext->pPrev = v7->pPrev;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 v7->pPrev->pNext = v7->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 v26 = v6->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 v6 = v6->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 for ( i = ptr_80CA10[v27]; i; i = i->ptr_18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 i->pPrev->pNext = i->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 i->pNext->pPrev = i->pPrev;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 v20 = stru_80C9D8.pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 if ( stru_80C9D8.pNext != &stru_80C9A4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 v1 = v24 + 52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 v24 += 52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 if ( (signed int)v27 > (signed int)pViewport->uViewportW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 v21 = v20->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 v22 = v20->field_4 + v20->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 v20->field_0 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 if ( v22 < stru_80C9D8.field_0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 v20->field_0 = stru_80C9D8.field_0 + 0.0000001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 v23 = v20->pPrev;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 if ( v20->field_0 >= (double)v23->field_0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 v23->pNext = v20->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 v20->pNext->pPrev = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 v23->pPrev->pNext = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 v20->pPrev = v23->pPrev;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 v20->pNext = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 v23->pPrev = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 v20 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 if ( v21 == &stru_80C9A4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 // 4EC3EC: using guessed type Edge defaultEdge;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 //----- (00487355) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 bool OutdoorCamera::_487355()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 stru148 *v1; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 bool result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 if ( pOutdoorCamera->numStru148s > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 v1 = array_77EC08;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 result = pGame->pLightmapBuilder->_45D3C7(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 while ( v0 < pOutdoorCamera->numStru148s );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 //----- (00487DA9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 void __cdecl sub_487DA9()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 char *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 v0 = &array_77EC08[0].field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 *v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 v0 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 while ( (signed int)v0 < (signed int)&pVerticesSR_801A10[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 //----- (00487DBE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 void Software_ResetNewEdges()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 int v0; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 Edge **v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 signed int v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 v1 = ptr_80CA10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 *((int *)&pNewEdges[v0] - 9) = (int)&defaultEdge;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 *v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 while ( (signed int)v1 < (signed int)&unk_80D190 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 v2 = 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 pSurfs->field_22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 --v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 while ( v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 // 4EC3EC: using guessed type Edge defaultEdge;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 //----- (00487E1D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 TileTable::~TileTable()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 if ( this->pTiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 pAllocator->FreeChunk(this->pTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 pTiles = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 uNumTiles = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 //----- (00487E3B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 TileDesc *TileTable::GetTileById(unsigned int uTileID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 TileDesc *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 if ( (uTileID & 0x80000000u) != 0 || (signed int)uTileID > (signed int)(this->uNumTiles - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 result = this->pTiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 result = &this->pTiles[uTileID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 //----- (00487E58) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 void TileTable::InitializeTileset(int uTerrainType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 TileTable *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 TileDesc *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 signed int i; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 for ( i = 0; i < (signed int)v2->uNumTiles; ++v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 v4 = &v2->pTiles[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 if ( uTerrainType == v4->uTerrainType && v4->pTileName[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 v2->pTiles[v3].uBitmapID = pBitmaps_LOD->LoadTexture(v4->pTileName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 if ( v2->pTiles[v3].uBitmapID != -1 )
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
1725 pBitmaps_LOD->pTextures[v2->pTiles[v3].uBitmapID].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v2->pTiles[v3].uBitmapID].palette_id1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 //----- (00487ED6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 int TileTable::method_487ED6(signed int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 TileTable *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736 int v5; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 int v6; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 unsigned int v8; // [sp-4h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 v4 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 if ( a1 > 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 if ( a2 || (v5 = rand() % 50, v5 < 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 if ( v5 < 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 if ( v5 < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 v8 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 if ( v5 < 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 v8 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 v6 = rand() % 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 v8 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 if ( v6 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 v8 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 if ( v6 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 v8 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 if ( v6 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 v8 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 if ( v6 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 v8 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 if ( v6 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 v8 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 if ( v6 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 v8 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 if ( v6 == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 v8 = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 return v4->GetTileId(a1, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 return v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 //----- (00487F84) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 unsigned int TileTable::GetTileId(unsigned int uTerrainType, unsigned int uSection)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 unsigned int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 unsigned __int16 *v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 v3 = this->uNumTiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 if ( (signed int)this->uNumTiles <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 v5 = &this->pTiles->uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 while ( (signed __int16)*(v5 - 1) != uTerrainType || (signed __int16)*v5 != uSection )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 v5 += 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 if ( (signed int)result >= (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 //----- (00487FB4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 void TileTable::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 TileTable *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 auto Str = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848 v1 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 v2 = fopen("data\\dtile.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 Abortf("Unable to save dtile.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 fwrite(v1->pTiles, 0x1Au, v1->uNumTiles, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 //----- (00488000) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 void TileTable::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 uNumTiles = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 pTiles = (TileDesc *)pAllocator->AllocNamedChunk(pTiles, 26 * uNumTiles, "Tile Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 memcpy(pTiles, (char *)pSerialized + 4, 26 * uNumTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 //----- (00488047) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 int TileTable::FromFileTxt(const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869 TileTable *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 unsigned int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 void *v5; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 unsigned __int16 v6; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 const char *v7; // ST14_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 unsigned __int16 v8; // ax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 const char *v9; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 int v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 int v13; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 int v14; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 int v15; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 int v16; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 int v17; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 int v18; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 int v19; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 int v20; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 int v21; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 int v22; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 int v23; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1891 int v24; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1892 int v25; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 int v26; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1894 int v27; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1895 int v28; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 int v29; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 int v30; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 int v31; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 int v32; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 int v33; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 int v34; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 const char *v35; // esi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 int v36; // eax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 int v37; // eax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 int v38; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 int v39; // eax@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 int v40; // eax@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 int v41; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 int v42; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 int v43; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 int v44; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 int v45; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 int v46; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 int v47; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 int v48; // eax@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 int v49; // eax@110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 int v50; // eax@112
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 int v51; // eax@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 int v52; // eax@116
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 int v53; // eax@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 int v54; // eax@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 int v55; // eax@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 int v56; // eax@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 int v57; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 int v58; // eax@128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 int v59; // eax@130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 int v60; // eax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 int v61; // eax@134
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 int v62; // eax@136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 int v63; // eax@138
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 int v64; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 int v65; // eax@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 int v66; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 int v67; // eax@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 int v68; // eax@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 int v69; // eax@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 int v70; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 int j; // edi@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 const char *v72; // esi@153
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 int v73; // eax@154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 int v74; // eax@156
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 int v75; // eax@160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 int v76; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944 int v77; // eax@164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 int v78; // eax@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 int v79; // eax@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 int v80; // eax@170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 FILE *i; // [sp-10h] [bp-304h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 FILE *File; // [sp+4h] [bp-2F0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 FrameTableTxtLine v84; // [sp+8h] [bp-2ECh]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 FrameTableTxtLine v85; // [sp+84h] [bp-270h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 char Buf; // [sp+100h] [bp-1F4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 v3 = fopen(pFilename, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 Abortf("TileTable::load - Unable to open file: %s.");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 for ( i = v3; fgets(&Buf, 490, i); i = File )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 memcpy(&v84, texture_frame_table_txt_parser(&Buf, &v85), sizeof(v84));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 if ( v84.field_0 && *v84.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 v2->uNumTiles = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 v5 = pAllocator->AllocNamedChunk(v2->pTiles, 26 * v4, "Tile Descrip");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 v2->pTiles = (TileDesc *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 Abortf("TileTable::Load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 memset(v5, 0, 26 * v2->uNumTiles);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 v2->uNumTiles = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 fseek(File, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 if ( fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 memcpy(&v84, texture_frame_table_txt_parser(&Buf, &v85), sizeof(v84));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 if ( v84.field_0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 if ( *v84.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 LABEL_173:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 if ( !fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 strcpy(v2->pTiles[v2->uNumTiles].pTileName, v84.pProperties[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 v6 = atoi(v84.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 v7 = v84.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 v2->pTiles[v2->uNumTiles].uTileID = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 v8 = atoi(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 v9 = v84.pProperties[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 v2->pTiles[v2->uNumTiles].uBitmapID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 v2->pTiles[v2->uNumTiles].uTerrainType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 if ( _strcmpi(v9, "TTtype_NULL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 if ( _strcmpi(v9, "TTtype_Start") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 if ( _strcmpi(v9, "TTtype_Grass") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 if ( _strcmpi(v9, "TTtype_Cracked") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 if ( _strcmpi(v9, "TTtype_Snow") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 if ( _strcmpi(v9, "TTtype_Sand") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 if ( _strcmpi(v9, "TTtype_Volcano") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 if ( _strcmpi(v9, "TTtype_Dirt") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 if ( _strcmpi(v9, "TTtype_Water") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 if ( _strcmpi(v9, "TTtype_Tropical") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 if ( _strcmpi(v9, "TTtype_Swamp") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 if ( _strcmpi(v9, "TTtype_City") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 if ( _strcmpi(v9, "TTtype_RoadGrassCobble") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 if ( _strcmpi(v9, "TTtype_RoadGrassDirt") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 if ( _strcmpi(v9, "TTtype_RoadCrackedCobble") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 if ( _strcmpi(v9, "TTtype_RoadCrackedDirt") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 if ( _strcmpi(v9, "TTtype_RoadSandCobble") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 if ( _strcmpi(v9, "TTtype_RoadSandDirt") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 if ( _strcmpi(v9, "TTtype_RoadVolcanoCobble") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 if ( _strcmpi(v9, "TTtype_RoadVolcanoDirt") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 if ( _strcmpi(v9, "TTtype_RoadSwampCobble") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 if ( _strcmpi(v9, "TTtype_RoadSwampDirt") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 if ( _strcmpi(v9, "TTtype_RoadTropicalCobble") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 if ( _strcmpi(v9, "TTtype_RoadTropicalDirt") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 if ( _strcmpi(v9, "TTtype_RoadSnowCobble") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 if ( _strcmpi(v9, "TTtype_RoadSnowDirt") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 if ( !_strcmpi(v9, "TTtype_RoadCityStone") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 v34 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 *(char *)v34 |= 0x1Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 v33 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 *(char *)v33 |= 0xDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 v32 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 *(char *)v32 |= 0xCu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 v31 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 *(char *)v31 |= 0x1Bu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 v30 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 *(char *)v30 |= 0x1Au;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 v29 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 *(char *)v29 |= 0x19u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 v28 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 *(char *)v28 |= 0x18u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 v27 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 *(char *)v27 |= 0x11u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 v26 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 *(char *)v26 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 v25 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 *(char *)v25 |= 0xFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 v24 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 *(char *)v24 |= 0xEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 v23 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 *(char *)v23 |= 0x17u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 v22 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 *(char *)v22 |= 0x16u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 v21 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 *(char *)v21 |= 0xBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136 v20 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 *(char *)v20 |= 0xAu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 v19 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 *(char *)v19 |= 9u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 v18 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 *(char *)v18 |= 7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 v17 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 *(char *)v17 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 v16 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 *(char *)v16 |= 5u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 v15 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 *(char *)v15 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 v14 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 *(char *)v14 |= 3u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 v13 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 *(char *)v13 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184 v12 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185 *(char *)v12 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 v11 = (int)&v2->pTiles[v2->uNumTiles].uTerrainType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 *(char *)v11 |= 6u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 v10 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 *(char *)v10 |= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 LOBYTE(v2->pTiles[v2->uNumTiles].uTerrainType) = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 v35 = v84.pProperties[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 v2->pTiles[v2->uNumTiles].uSection = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 v2->pTiles[v2->uNumTiles].uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 if ( !_strcmpi(v35, "TTsect_NULL") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 LOBYTE(v2->pTiles[v2->uNumTiles].uSection) = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212 for ( j = 5; j < v84.field_0; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 v72 = v84.pProperties[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 if ( _strcmpi(v84.pProperties[j], "TTattr_Burn") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 if ( _strcmpi(v72, "TTattr_Water") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 if ( _strcmpi(v72, "TTattr_Water2") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 if ( _strcmpi(v72, "TTattr_Block") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 if ( _strcmpi(v72, "TTattr_Repulse") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 if ( _strcmpi(v72, "TTattr_Flat") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 if ( _strcmpi(v72, "TTattr_Wave") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229 if ( _strcmpi(v72, "TTattr_NoDraw") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 if ( !_strcmpi(v72, "TTattr_Transition") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 v80 = (int)&v2->pTiles[v2->uNumTiles].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 *(short *)v80 |= 0x200u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 v79 = (int)&v2->pTiles[v2->uNumTiles].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 *(char *)v79 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 v78 = (int)&v2->pTiles[v2->uNumTiles].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 *(char *)v78 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 v77 = (int)&v2->pTiles[v2->uNumTiles].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 *(char *)v77 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 v76 = (int)&v2->pTiles[v2->uNumTiles].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 *(char *)v76 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 v75 = (int)&v2->pTiles[v2->uNumTiles].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 *(char *)v75 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 HIBYTE(v2->pTiles[v2->uNumTiles].uAttributes) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 v74 = (int)&v2->pTiles[v2->uNumTiles].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 *(char *)v74 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 v73 = (int)&v2->pTiles[v2->uNumTiles].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 *(char *)v73 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 ++v2->uNumTiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 goto LABEL_173;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 if ( !_strcmpi(v35, "TTsect_Start") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 v36 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 *(char *)v36 |= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 if ( !_strcmpi(v35, "TTsect_Base1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 if ( !_strcmpi(v35, "TTsect_Base2") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 v37 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 *(char *)v37 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 if ( !_strcmpi(v35, "TTsect_Base3") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 v38 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 *(char *)v38 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 if ( !_strcmpi(v35, "TTsect_Base4") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 v39 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310 *(char *)v39 |= 3u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2313 if ( !_strcmpi(v35, "TTsect_Special1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 v40 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2316 *(char *)v40 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2319 if ( !_strcmpi(v35, "TTsect_Special2") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 v41 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322 *(char *)v41 |= 5u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2323 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325 if ( !_strcmpi(v35, "TTsect_Special3") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 v42 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2328 *(char *)v42 |= 6u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2329 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2331 if ( !_strcmpi(v35, "TTsect_Special4") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2333 v43 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2334 *(char *)v43 |= 7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2335 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2337 if ( !_strcmpi(v35, "TTsect_Special5") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2339 v44 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2340 *(char *)v44 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 if ( !_strcmpi(v35, "TTsect_Special6") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 v45 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 *(char *)v45 |= 9u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2349 if ( !_strcmpi(v35, "TTsect_Special7") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351 v46 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 *(char *)v46 |= 0xAu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2353 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 if ( !_strcmpi(v35, "TTsect_Special8") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 v47 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 *(char *)v47 |= 0xBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 if ( !_strcmpi(v35, "TTsect_NE1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 if ( !_strcmpi(v35, "TTsect_NW1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 goto LABEL_134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 if ( !_strcmpi(v35, "TTsect_SE1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 if ( !_strcmpi(v35, "TTsect_SW1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 goto LABEL_134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 if ( !_strcmpi(v35, "TTsect_E1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 if ( !_strcmpi(v35, "TTsect_W1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 goto LABEL_140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 if ( !_strcmpi(v35, "TTsect_N1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 goto LABEL_142;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 if ( !_strcmpi(v35, "TTsect_S1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2376 goto LABEL_144;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 if ( !_strcmpi(v35, "TTsect_XNE1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 goto LABEL_146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 if ( _strcmpi(v35, "TTsect_XNW1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 if ( !_strcmpi(v35, "TTsect_XSE1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 goto LABEL_146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 if ( _strcmpi(v35, "TTsect_XSW1") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 if ( !_strcmpi(v35, "TTsect_CROS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 v70 = (int)&v2->pTiles[v2->uNumTiles].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 *(short *)v70 |= 0x200u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 if ( !_strcmpi(v35, "TTsect_NS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 v48 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 *(char *)v48 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 if ( !_strcmpi(v35, "TTsect_EW") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 v49 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 *(char *)v49 |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 if ( !_strcmpi(v35, "TTsect_N_E") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 v50 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 *(char *)v50 |= 3u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2408 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 if ( !_strcmpi(v35, "TTsect_N_W") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2412 v51 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2413 *(char *)v51 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2414 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2416 if ( !_strcmpi(v35, "TTsect_S_E") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2418 v52 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 *(char *)v52 |= 5u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2420 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2422 if ( !_strcmpi(v35, "TTsect_S_W") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2424 v53 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 *(char *)v53 |= 6u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2426 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2428 if ( !_strcmpi(v35, "TTsect_NS_E") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 v54 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2431 *(char *)v54 |= 7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2434 if ( !_strcmpi(v35, "TTsect_NS_W") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2436 v55 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2437 *(char *)v55 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2438 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2440 if ( !_strcmpi(v35, "TTsect_EW_N") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 v56 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2443 *(char *)v56 |= 9u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2444 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 if ( !_strcmpi(v35, "TTsect_EW_S") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2448 v57 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2449 *(char *)v57 |= 0xAu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2450 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2452 if ( !_strcmpi(v35, "TTsect_NCAP") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2454 v58 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2455 *(char *)v58 |= 0xBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2458 if ( !_strcmpi(v35, "TTsect_ECAP") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 LABEL_130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2461 v59 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2462 *(char *)v59 |= 0xCu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2463 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2465 if ( !_strcmpi(v35, "TTsect_SCAP") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2467 v60 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2468 *(char *)v60 |= 0xDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2469 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2471 if ( !_strcmpi(v35, "TTsect_WCAP") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2473 LABEL_134:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2474 v61 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2475 *(char *)v61 |= 0xEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2476 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2478 if ( !_strcmpi(v35, "TTsect_DN") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2480 v62 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2481 *(char *)v62 |= 0xFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2482 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2484 if ( !_strcmpi(v35, "TTsect_DS") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2486 LABEL_138:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2487 v63 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2488 *(char *)v63 |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2489 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2491 if ( !_strcmpi(v35, "TTsect_DW") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2493 LABEL_140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2494 v64 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2495 *(char *)v64 |= 0x11u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2496 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2498 if ( !_strcmpi(v35, "TTsect_DE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2500 LABEL_142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2501 v65 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2502 *(char *)v65 |= 0x12u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2503 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2505 if ( !_strcmpi(v35, "TTsect_DSW") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2507 LABEL_144:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2508 v66 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2509 *(char *)v66 |= 0x13u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2510 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2512 if ( !_strcmpi(v35, "TTsect_DNE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2514 LABEL_146:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2515 v67 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2516 *(char *)v67 |= 0x14u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2517 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2519 if ( !_strcmpi(v35, "TTsect_DSE") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2521 v68 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2522 *(char *)v68 |= 0x15u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2523 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 if ( _strcmpi(v35, "TTsect_DNW") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2526 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2529 v69 = (int)&v2->pTiles[v2->uNumTiles].uSection;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2530 *(char *)v69 |= 0x16u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2533 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2534 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2535 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2537
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2538
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2539
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2540 //----- (0048958E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2541 stru12_MemoryBlock::stru12_MemoryBlock(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2543 stru12_MemoryBlock *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 void *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2545 void *v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2546 stru12_MemoryBlock *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2547
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2548 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2549 v3 = operator new(8 * a2 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2550 v2->pBlockBase = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2551 v4 = (char *)v3 + (-(signed int)v3 & 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 result = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 v2->pAlignedBlock = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 //----- (004895B7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2557 stru12::stru12(stru11 *pStru11)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2559 stru12 *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2560
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2562 this->field_44 = 0x41000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 this->field_4C = 0x46000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2564 //this->vdestructor_ptr = stru12::_4898E6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 this->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 this->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2567 this->field_54 = 0x33D6BF95u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 this->field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 for (int i = 0; i < 12; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2571 v2->pMemBlocks[i] = new stru12_MemoryBlock(640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 /*
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573 v3 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 v4 = AllocAlignedMem(v3, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2578 v2->pMemBlocks[0] = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 /*v5 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 v6 = AllocAlignedMem(v5, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 v2->pMemBlocks[1] = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 v7 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2586 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 v8 = AllocAlignedMem(v7, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2589 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2590 v2->pMemBlocks[2] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 v9 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2592 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2593 v10 = AllocAlignedMem(v9, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2594 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2595 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 v2->pMemBlocks[3] = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 v11 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 v12 = AllocAlignedMem(v11, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2600 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 v2->pMemBlocks[4] = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2603 v13 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 v14 = AllocAlignedMem(v13, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2606 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2607 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 v2->pMemBlocks[5] = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2609 v15 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2610 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 v16 = AllocAlignedMem(v15, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2613 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 v2->pMemBlocks[6] = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 v17 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2616 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2617 v18 = AllocAlignedMem(v17, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2619 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2620 v2->pMemBlocks[7] = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 v19 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2623 v20 = AllocAlignedMem(v19, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2626 v2->pMemBlocks[8] = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2627 v21 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2629 v22 = AllocAlignedMem(v21, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2632 v2->pMemBlocks[9] = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2633 v23 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 if ( v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2635 v24 = AllocAlignedMem(v23, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2637 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2638 v2->pMemBlocks[10] = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 v25 = (stru12_MemoryBlock *)operator new(8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2641 v26 = AllocAlignedMem(v25, 640);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2643 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 v2->field_8C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645 v2->pMemBlocks[11] = v26;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2647
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2648 //----- (00489810) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2649 stru12::~stru12()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2651 for (int i = 0; i < 12; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2652 delete pMemBlocks[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2653 /*if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2654 stru12_MemoryBlock::dtor(v2, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2655 v3 = v1->pMemBlocks[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2656 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2657 stru12_MemoryBlock::dtor(v3, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2658 v4 = v1->pMemBlocks[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2659 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2660 stru12_MemoryBlock::dtor(v4, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2661 v5 = v1->pMemBlocks[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2662 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2663 stru12_MemoryBlock::dtor(v5, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2664 v6 = v1->pMemBlocks[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2665 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2666 stru12_MemoryBlock::dtor(v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2667 v7 = v1->pMemBlocks[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2668 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2669 stru12_MemoryBlock::dtor(v7, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2670 v8 = v1->pMemBlocks[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 stru12_MemoryBlock::dtor(v8, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2673 v9 = v1->pMemBlocks[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2674 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2675 stru12_MemoryBlock::dtor(v9, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2676 v10 = v1->pMemBlocks[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2678 stru12_MemoryBlock::dtor(v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2679 v11 = v1->pMemBlocks[9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2680 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2681 stru12_MemoryBlock::dtor(v11, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 v12 = v1->pMemBlocks[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2684 stru12_MemoryBlock::dtor(v12, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2685 v13 = v1->pMemBlocks[11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2686 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2687 stru12_MemoryBlock::dtor(v13, 1);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 //----- (004898BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 stru12_MemoryBlock::~stru12_MemoryBlock()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2693 stru12_MemoryBlock *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 void *v3; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2696 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2697 v3 = this->pBlockBase;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2698 this->pAlignedBlock = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2699 free(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 v2->pBlockBase = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 /*if ( a2 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2702 free(v2);*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 //----- (004898E6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 void stru12::_4898E6()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 void *v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2709 void *v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 char *v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 double v4; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 char *v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 double v6; // st6@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 double v7; // st5@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2715 double v8; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 int v9; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 double v10; // st3@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 float v11; // ST34_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 double v12; // st6@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 double v13; // ST0C_8@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 char *v14; // [sp+14h] [bp-44h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 char *v15; // [sp+18h] [bp-40h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 char *v16; // [sp+1Ch] [bp-3Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 char *v17; // [sp+20h] [bp-38h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 char *v18; // [sp+24h] [bp-34h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 float v19; // [sp+30h] [bp-28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 float v20; // [sp+38h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 char *v21; // [sp+3Ch] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 int v22; // [sp+40h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 char *v23; // [sp+44h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 char *v24; // [sp+48h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 int v25; // [sp+4Ch] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 float v26; // [sp+50h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 float v27; // [sp+54h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 v1 = this->pMemBlocks[1]->pAlignedBlock;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 v2 = this->pMemBlocks[6]->pAlignedBlock;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 if ( this->field_8C > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2741 v24 = (char *)((char *)pMemBlocks[0]->pAlignedBlock - v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 v23 = (char *)((char *)pMemBlocks[2]->pAlignedBlock - v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 v18 = (char *)((char *)pMemBlocks[7]->pAlignedBlock - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 v17 = (char *)((char *)pMemBlocks[8]->pAlignedBlock - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 v25 = (int)v1 - (int)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 v16 = (char *)((char *)pMemBlocks[9]->pAlignedBlock - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2747 v3 = (char *)((char *)pMemBlocks[4]->pAlignedBlock - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 v15 = (char *)((char *)pMemBlocks[10]->pAlignedBlock - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 v4 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 v5 = (char *)((char *)pMemBlocks[5]->pAlignedBlock - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 v21 = (char *)((char *)pMemBlocks[3]->pAlignedBlock - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2752 v14 = (char *)((char *)pMemBlocks[11]->pAlignedBlock - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 v26 = *(float *)&v24[(int)((char *)v2 + v25)] - (double)pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 v27 = *(float *)((char *)v2 + v25) - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2757 v6 = *(float *)&v23[(int)((char *)v2 + v25)] - (double)pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2758 v7 = pIndoorCamera->fRotationYCosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2759 v8 = pIndoorCamera->fRotationYSine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 v20 = pIndoorCamera->fRotationXCosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2761 v19 = pIndoorCamera->fRotationXSine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2762 v9 = (int)((char *)v2 + (int)v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2763 v10 = v27 * pIndoorCamera->fRotationYSine + pIndoorCamera->fRotationYCosine * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2764 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2767 *(float *)v9 = v11 * pIndoorCamera->fRotationXCosine + pIndoorCamera->fRotationXSine * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2768 *(float *)((char *)v2 + (int)v3) = v7 * v27 - v8 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 *(float *)((char *)v2 + (int)v5) = v20 * v6 - v11 * v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2771 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2773 *(float *)v9 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 *(float *)((char *)v2 + (int)v3) = v7 * v27 - v8 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2775 *(float *)((char *)v2 + (int)v5) = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 if ( *(float *)v9 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2779 if ( (double)pOutdoorCamera->shading_dist_mist >= *(float *)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 *(int *)v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 v12 = v4 / (*(float *)v9 + 0.0000001) * (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 *(float *)((char *)v2 + (int)v18) = (double)pViewport->uScreenCenterX
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2784 - v12 * *(float *)((char *)v2 + (int)v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2785 *(float *)((char *)v2 + (int)v17) = (double)pViewport->uScreenCenterY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 - v12 * *(float *)((char *)v2 + (int)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 *(float *)((char *)v2 + (int)v16) = v4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2788 - v4 / (*(float *)v9 * 1000.0 / (double)pOutdoorCamera->shading_dist_mist);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 *(float *)((char *)v2 + (int)v15) = v4 / (*(float *)v9 + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 v13 = *(float *)v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2791 v4 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 *(int *)((char *)v2 + (int)v14) = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2794 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2796 *(int *)v2 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2799 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2801 *(int *)v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2803 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2804 v2 = (char *)v2 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 while ( v22 < this->field_8C );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2808 this->field_8C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2810
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2812
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2813
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 //----- (0048A959) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2816 unsigned int sub_48A959(int _this, float a2, float a3, float a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2818 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2819 double v5; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2820 double v6; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 __int64 v8; // [sp+14h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2822 double v9; // [sp+1Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2823 int a6; // [sp+24h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2824 float v11; // [sp+28h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2825 float v12; // [sp+2Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2826 float a1; // [sp+30h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2827 float a2a; // [sp+3Ch] [bp+8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 float a2b; // [sp+3Ch] [bp+8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 float a2c; // [sp+3Ch] [bp+8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2830 int a3a; // [sp+40h] [bp+Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2832 v4 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2833 v8 = ((unsigned int)_this >> 16) & 0xFFi64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 v5 = (double)v8 * 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 v8 = (unsigned __int16)_this >> 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2836 a1 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 v6 = (double)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 v8 = _this & 0xFFi64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2839 v12 = v6 * 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 v11 = (double)v8 * 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 RGB2HSV((float *)&v8 + 1, (float *)&v9 + 1, a1, v12, v11, (float *)&a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2842 if ( a2 != -1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 HIDWORD(v8) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 if ( a3 != -1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 HIDWORD(v9) = LODWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 if ( a4 != -1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2847 a6 = LODWORD(a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 HSV2RGB(&a1, &v12, &v11, *((float *)&v8 + 1), *((float *)&v9 + 1), *(float *)&a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 a2a = a1 * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2850 *(double *)&v8 = a2a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 a3a = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 a2b = v12 * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 *(double *)&v8 = a2b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 a2c = v11 * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 v9 = a2c + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 return LODWORD(v9) | v4 & 0xFF000000 | (((unsigned int)v8 | (a3a << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2858
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2859
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2860 //----- (0048B561) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 int _48B561_mess_with_scaling_along_z(/*int a1, */float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2862 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
2863 //v2 = a2 - 0.5;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
2864 //v3 = v2 + 6.7553994e15;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
2865 int v4 = floorf(a2 - 0.5f + 0.5f);
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
2866 //v7 = (a2 - (double)SLODWORD(v3)) * 65536.0;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
2867 //v5 = v7 + 6.7553994e15;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
2868 //return LODWORD(v5) | (v4 << 16);
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
2869 int v5 = floorf((a2 - v4) * 65536.0f + 0.5f);
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
2870 return v5 | (v4 << 16);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2875
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2876 //----- (004908DE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 signed int __cdecl sub_4908DE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 char *v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 signed int v1; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2881 char *v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2882 signed int v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2883
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 v0 = (char *)pParty->pPlayers[0].pActiveSkills;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2887 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2888 v2 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2889 v3 = 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2892 if ( *(short *)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2893 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2894 v2 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2895 --v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2897 while ( v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 if ( v1 < 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2899 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 v0 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 if ( (signed int)v0 >= (signed int)&pParty->field_777C[18] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 //----- (00491CB5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2911 void __cdecl LoadPlayerPortraintsAndVoices()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 Texture **v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 int v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 char *v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2917 char *v4; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2918
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2919 pIcons_LOD->dword_011BA0 = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2920 v0 = (Texture **)pTextures_PlayerFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2921 v4 = (char *)&pParty->pPlayers[0].uFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2922 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2924 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2925 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927 v2 = v1 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2928 sprintfex(pTmpBuf, "%s%02d", pPlayerPortraitsNames[*v4], v1 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 *v0 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 v1 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 while ( v2 < 56 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2934 v4 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 while ( (signed int)v4 < (signed int)((char *)&pParty->pPickedItem.uExpireTime + 6) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 pTexture_PlayerFaceEradicated = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ERADCATE", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 pTexture_PlayerFaceDead = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("DEAD", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 v3 = (char *)&pParty->pPlayers[0].uVoiceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2940 pTexture_PlayerFaceMask = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("FACEMASK", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2943 if ( byte_4ED498 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2945 pSoundList->_4A9A67(2 * ((unsigned __int8)byte_4ED498 + 50 * *(int *)v3) + 4998, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 pSoundList->_4A9A67(2 * ((unsigned __int8)byte_4ED498 + 50 * *(int *)v3) + 4999, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 v3 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 while ( (signed int)v3 < (signed int)&pParty->field_871C[560] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 // 4ED498: using guessed type char byte_4ED498;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 //----- (00491DE7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 int __fastcall ReloadPlayerPortraits(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 char **v3; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959 Texture **v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2960 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 v3 = &pPlayerPortraitsNames[a2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 v4 = pTextures_PlayerFaces[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 v5 = result + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 sprintfex(pTmpBuf, "%s%02d", *v3, result + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 pIcons_LOD->ReloadTexture(*v4, pTmpBuf, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 result = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 while ( v5 < 56 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2974 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 // 491DE7: using guessed type int __fastcall ReloadPlayerPortraits(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 //----- (00491E3A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2979 void __cdecl sub_491E3A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2981 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 signed int v1; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2983 char *v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 unsigned int v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2985 unsigned int v4; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2986 char *v5; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2987 int v6; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988 Texture *v7; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2989 struct IDirect3DTexture2 **v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 struct IDirect3DTexture2 *v9; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2991 struct IDirectDrawSurface **v10; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2992 struct IDirectDrawSurface *v11; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 int v12; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995 v0 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 if ( byte_4ED498 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 if ( (signed int)pSoundList->uNumSounds <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3006 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3008 v2 = (char *)&pSoundList->pSounds->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 while ( *(int *)v2 != 2 * ((unsigned __int8)byte_4ED498 + 50 * v0->uVoiceID) + 4998 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012 v2 += 120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013 if ( v1 >= (signed int)pSoundList->uNumSounds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 v3 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 pSoundList->_4A9DCD(v3, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 if ( (signed int)pSoundList->uNumSounds <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 v5 = (char *)&pSoundList->pSounds->uSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 while ( *(int *)v5 != 2 * ((unsigned __int8)byte_4ED498 + 50 * v0->uVoiceID) + 4999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 v5 += 120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 if ( (signed int)v4 >= (signed int)pSoundList->uNumSounds )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 pSoundList->_4A9DCD(v4, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 while ( (signed int)v0 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 v6 = pIcons_LOD->uNumLoadedFiles - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 if ( v6 >= pIcons_LOD->dword_011BA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 v7 = &pIcons_LOD->pTextures[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 v7->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 v8 = pIcons_LOD->pHardwareTextures;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 v9 = v8[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 v9->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 pIcons_LOD->pHardwareTextures[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 v10 = pIcons_LOD->pHardwareSurfaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 v11 = v10[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 v11->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 pIcons_LOD->pHardwareSurfaces[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071 while ( v6 >= pIcons_LOD->dword_011BA0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073 v12 = pIcons_LOD->dword_011BA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 pIcons_LOD->dword_011BA0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 pIcons_LOD->uNumLoadedFiles = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 // 4ED498: using guessed type char byte_4ED498;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 //----- (00491F87) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 void __cdecl DrawHiredNPCs()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 int v0; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 int v2; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 signed int v3; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 char *v4; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 int v5; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 int v6; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 char v7; // al@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 unsigned int v8; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 int v9; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 int v10; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 unsigned int v11; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 unsigned int v12; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 unsigned int v13; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 IconFrame *v14; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 unsigned int v15; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098 char pContainer; // [sp+Ch] [bp-30h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 unsigned int v17; // [sp+20h] [bp-1Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 signed int uFrameID; // [sp+24h] [bp-18h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 int i; // [sp+28h] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 unsigned int v20; // [sp+2Ch] [bp-10h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 unsigned int v21; // [sp+30h] [bp-Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 int v22; // [sp+34h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 unsigned __int8 v23; // [sp+3Bh] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 if ( bNoNPCHiring != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 v1 = (char *)pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 if ( *(int *)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 v2 = v22++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 pTmpBuf[v2] = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 v1 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 while ( (signed int)v1 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 v4 = (char *)pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130 if ( v4[8] & 0x80 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v4, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3132 if ( !pParty->pHirelings[1].pName || strcmp(*(const char **)v4, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 v5 = v22++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3135 pTmpBuf[v5] = v3 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3138 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3139 v4 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 while ( v3 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 v6 = (unsigned __int8)pParty->field_709;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 for ( i = (unsigned __int8)pParty->field_709; i < v22; v6 = i++ + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146 if ( v23 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3148 v7 = pTmpBuf[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3149 if ( (unsigned __int8)v7 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3151 sprintfex(&pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)v7 + 499].uPortraitID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3152 v15 = pIcons_LOD->LoadTexture(&pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 pHiredNPCsIconsOffsetsX[v23],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 pHiredNPCsIconsOffsetsY[v23],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 (Texture *)(v15 != -1 ? 72 * v15 + 7145548 : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3158 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 sprintfex(&pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)v7].uPortraitID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3161 v8 = pIcons_LOD->LoadTexture(&pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 v9 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3163 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3164 pHiredNPCsIconsOffsetsX[v9],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 pHiredNPCsIconsOffsetsY[v9],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3166 (Texture *)(v8 != -1 ? (int)&pIcons_LOD->pTextures[v8] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3167 v10 = (unsigned __int8)pTmpBuf[i];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 if ( pParty->pHirelings[v10].bDrawSomeAnim == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 uFrameID = pParty->pHirelings[v10].evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 v11 = pHiredNPCsIconsOffsetsX[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3172 v12 = pHiredNPCsIconsOffsetsY[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 v17 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 if ( (signed int)pIconsFrameTable->uNumIcons <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 while ( _strcmpi("spell96", pIconsFrameTable->pIcons[v20 / 0x20].pAnimationName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 v20 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 if ( (signed int)v21 >= (signed int)pIconsFrameTable->uNumIcons )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 v13 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 v14 = pIconsFrameTable->GetFrame(v13, uFrameID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 pRenderer->DrawTextureTransparent(v17, v12, &pIcons_LOD->pTextures[v14->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3196 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 // 6BE3C5: using guessed type char bNoNPCHiring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3202
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3204 //----- (004921C1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 void GameUI_DrawPortraits(unsigned int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 signed int v1; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 int v2; // ebp@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 char *v3; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 Texture *v4; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211 signed int v5; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 PlayerFrame *v6; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 unsigned int v7; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 PlayerFrame *v8; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 unsigned int v9; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3216 bool v10; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 bool v11; // edi@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 bool v12; // edx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3219 bool v13; // ecx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 int v14; // esi@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221 char *v15; // edi@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 int v16; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 __int16 *v17; // esi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 char *v18; // edi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 int v19; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 Texture *v20; // [sp-4h] [bp-1Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 signed int v21; // [sp+10h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 unsigned int v22; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 v22 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 if ( qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233 qword_A750D8 -= (signed int)pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 if ( qword_A750D8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 if ( pPlayers[word_A750E2]->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 pPlayers[word_A750E2]->PlaySound(word_A750E0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 qword_A750D8 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 v21 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 v3 = (char *)&pParty->pPlayers[0].pConditions[14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 if ( *((_QWORD *)v3 + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 v4 = pTexture_PlayerFaceEradicated;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 v20 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 if ( pParty->pPartyBuffs[11].uExpireTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 pRenderer->_4A6E7E(v9, 0x183u, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 v10 = *((int *)v3 + 1541) >= v1 && (*((int *)v3 + 1541) > v1 || *((int *)v3 + 1540) > (unsigned int)v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 if ( *((int *)v3 + 1489) >= v1 && (*((int *)v3 + 1489) > v1 || *((int *)v3 + 1488) > (unsigned int)v1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 v11 = *((_QWORD *)v3 + 758) > 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 v12 = *((_QWORD *)v3 + 756) > 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 v13 = *((_QWORD *)v3 + 768) > 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 if ( v13 | v12 | v11 | v1 | v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 sub_441A4E(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 if ( *(_QWORD *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 v4 = pTexture_PlayerFaceDead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 if ( (signed int)pPlayerFrameTable->uNumFrames <= v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 v6 = pPlayerFrameTable->pFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 while ( v6->uSequenceID != *((short *)v3 + 3350) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 if ( v5 >= (signed int)pPlayerFrameTable->uNumFrames )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 v7 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 if ( v7 == v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 if ( *((short *)v3 + 3350) == 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 v8 = pPlayerFrameTable->GetFrameBy_y(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 (int *)v3 + 1678,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 (int *)v3 + 1677,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 pMiscTimer->uTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 v8 = pPlayerFrameTable->GetFrameBy_x(v7, *((short *)v3 + 3351));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 if ( *((short *)v3 + 3353) != v8->uTextureID - 1 || v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 *((short *)v3 + 3353) = v8->uTextureID - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 v4 = (Texture *)A74CEC_player_faces_minus1_indexing[v21 + v8->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 v21 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 v3 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 if ( (signed int)v3 >= (signed int)&pParty->pHirelings[1].field_24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 if ( pTurnEngine->field_4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 if ( (pTurnEngine->pQueue[0].uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 if ( pTurnEngine->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 v15 = (char *)pTurnEngine->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 if ( (*v15 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 v16 = dword_5079D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 if ( pParty->uFlags & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 v16 = dword_5079CC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 if ( pParty->uFlags & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 v16 = dword_5079C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[*(int *)v15 >> 3] - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 0x181u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 (Texture *)(v16 != -1 ? (int)&pIcons_LOD->pTextures[v16] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 v15 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 while ( v14 < pTurnEngine->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 v17 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 v18 = (char *)pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 if ( ((Player *)v18)->CanAct() && !*((short *)v18 + 3226) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 v19 = dword_5079D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 if ( pParty->uFlags & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 v19 = dword_5079CC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 if ( pParty->uFlags & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 v19 = dword_5079C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 *v17 - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 0x181u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 (Texture *)(v19 != -1 ? (int)&pIcons_LOD->pTextures[v19] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 v18 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 while ( (signed int)v18 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 //----- (0049387A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 int CycleCharacter(unsigned int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 signed int v2; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 signed int v3; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 result = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 if ( _this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 --result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 if ( result < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 result = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 if ( !pPlayers[result]->uTimeToRecovery )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 if ( v2 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 return uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 if ( result > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 if ( !pPlayers[result]->uTimeToRecovery )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 if ( v3 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 return uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 //----- (004938D1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 void __fastcall Rest(unsigned int uHoursToSleep)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 double v2; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 Player **v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 v1 = uHoursToSleep;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 if ( uHoursToSleep > 240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 UpdateActors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436 v2 = (double)(7680 * v1) * 0.033333335;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 pParty->uTimePlayed += (signed __int64)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 v3 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 (*v3)->Recover((signed __int64)v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444 while ( (signed int)v3 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 _494035_timed_effects__water_walking_damage__etc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 //----- (00493938) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449 int __cdecl _493938_regenerate()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 signed __int64 v1; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3453 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 int v5; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 char v7; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 char *v8; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 int v9; // edi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 signed int v10; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 __int16 *v11; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 int v12; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 int v13; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465 unsigned int *v14; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 unsigned int v15; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 unsigned int v16; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 int v17; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 int v18; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 signed int v19; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 signed int v20; // ebx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 Player *v21; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 ITEM_EQUIP_TYPE v22; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3474 int v23; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 signed int v24; // ecx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 signed int v25; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 int v26; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 int v27; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 int v28; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 int v29; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 int v30; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 signed int v31; // ecx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 char *v32; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 char *v33; // edi@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 int v34; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 int v35; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 char *v36; // edi@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 int v37; // edi@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 int v38; // edi@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 int v39; // edi@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 int v40; // ecx@113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 char v41[400]; // [sp+4h] [bp-22Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 LayingItem a1; // [sp+194h] [bp-9Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 Vec3_int_ a3; // [sp+204h] [bp-2Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 int v44; // [sp+210h] [bp-20h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 int v45; // [sp+214h] [bp-1Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 int v46; // [sp+218h] [bp-18h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 int v47; // [sp+21Ch] [bp-14h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 int v48; // [sp+220h] [bp-10h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 int v49; // [sp+224h] [bp-Ch]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 int v50; // [sp+228h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 int v51; // [sp+22Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 v0 = (signed int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 v1 = (signed __int64)((double)pParty->uLastRegenerationTime * 0.234375);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 v2 = (signed int)v1 / 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 result = (signed int)v1 / 60 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 if ( v0 >= result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 v4 = (v0 - v2) / 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 if ( !(pParty->pPartyBuffs[7].uFlags & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 v5 = v4 * pParty->pPartyBuffs[7].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 v6 = &stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 v7 = *(int *)v6 - v5 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 *(int *)v6 -= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 *(int *)v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 pParty->uFlags &= 0xFFFFFFBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 v51 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 if ( (signed __int64)pParty->pPartyBuffs[18].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 if ( pParty->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 if ( !(pParty->pPartyBuffs[18].uFlags & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 v8 = &stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 v7 = *(int *)v8 - v4 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 *(int *)v8 -= v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 *(int *)v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 v51 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 if ( SHIDWORD(pParty->pPartyBuffs[10].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 && (SHIDWORD(pParty->pPartyBuffs[10].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[10].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 //LayingItem::LayingItem(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 a3.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 a3.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 a3.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 a1.field_4C = pParty->pPartyBuffs[10].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 a1.field_50 = pParty->pPartyBuffs[10].uSkill;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 a1.uItemType = 1070;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 a1.field_48 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 LOWORD(v10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 v11 = &pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 while ( stru_4E3ACC[8].uItemType != *v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 v11 += 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 if ( v10 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 a1.uObjectDescID = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 a1.field_60_distance_related_prolly_lod = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 v12 = 8 * pParty->pPartyBuffs[10].uCaster;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 LOBYTE(v12) = v12 | 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 a1.uAttributes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 a1.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 a1.field_58 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 a1.uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 v13 = sub_46A89E((int)v41, 100, 307);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 if ( v13 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 v14 = (unsigned int *)&v41[4 * v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 v16 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 a1.vPosition.x = pActors[v16].vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 v17 = pActors[v16].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 a1.vPosition.z = pActors[v16].vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 v18 = 8 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 LOBYTE(v18) = 8 * v15 | 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 a1.vPosition.y = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 a1.field_5C = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 v19 = a1.Create(0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 DamageMonsterFromParty(8 * v19 | 2, *v14, &a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 while ( v9 < v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 if ( sub_476387() == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3614 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618 v21 = &pParty->pPlayers[v49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3620 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3621 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3622 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624 if ( v44 && v21->uClass == 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626 if ( v21->uClass == 35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 v22 = (ITEM_EQUIP_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 if ( v21->HasItemEquipped(v22) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
3633 v24 = *(int *)&v21->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v23 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634 if ( v24 > 134 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636 if ( v24 == 529 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 if ( v24 == 535 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3639 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 if ( v24 == 515 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 v47 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3644 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3646 if ( v24 == 532 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 v25 = *(int *)&v21->field_1F5[36 * *(int *)v23 + 7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 if ( v25 <= 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 if ( v25 != 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 v26 = v25 - 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 if ( v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 v27 = v26 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 if ( !v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3662 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 v28 = v27 - 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 if ( v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 if ( v28 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3668 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678 v29 = v25 - 54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679 if ( !v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3680 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681 v30 = v29 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 if ( !v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3683 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3684 if ( v30 == 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3686 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3687 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3689 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 v22 = (ITEM_EQUIP_TYPE)((int)v22 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3695 if ( (signed int)v22 >= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 v32 = (char *)v21->pInventoryItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 while ( *(int *)v32 != 601 || (unsigned __int8)v32[26] != v49 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 v32 += 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 if ( v31 >= 138 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3708 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3709 v45 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3712 if ( v21->pConditions[17] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 v46 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714 if ( v20 && !v21->pConditions[14] && !v21->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 ++v21->sHealth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717 if ( v21->sHealth > v21->GetMaxHealth() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 v21->sHealth = v21->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 if ( v21->pConditions[13] && v21->sHealth > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 LODWORD(v21->pConditions[13]) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 HIDWORD(v21->pConditions[13]) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 v51 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 if ( SHIDWORD(v21->pPlayerBuffs[12].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 && (SHIDWORD(v21->pPlayerBuffs[12].uExpireTime) > 0 || LODWORD(v21->pPlayerBuffs[12].uExpireTime))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 && !v21->pConditions[14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 && !v21->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 v21->sHealth += 5 * v21->pPlayerBuffs[12].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 if ( v21->sHealth > v21->GetMaxHealth() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 v21->sHealth = v21->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 if ( v21->pConditions[13] && v21->sHealth > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 LODWORD(v21->pConditions[13]) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 HIDWORD(v21->pConditions[13]) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 v51 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 v33 = (char *)&v21->sMana;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 ++*(int *)v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 if ( v21->sMana > v21->GetMaxMana() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 *(int *)v33 = v21->GetMaxMana();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 v51 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 if ( v47 && !v21->pConditions[14] && !v21->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 v34 = LODWORD(v21->pConditions[13]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 --v21->sHealth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 v35 = v21->sHealth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 if ( !(HIDWORD(v21->pConditions[13]) | v34) && v35 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 v21->pConditions[13] = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 if ( v35 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 if ( v21->sHealth + v21->uEndurance + v21->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) >= 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 || (signed __int64)v21->pPlayerBuffs[11].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 v21->pConditions[13] = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 if ( !v21->pConditions[14] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 v21->pConditions[14] = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 v51 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771 if ( v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 v36 = (char *)&v21->sMana;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774 ++*(int *)v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3775 if ( v21->sMana > v21->GetMaxMana() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 *(int *)v36 = v21->GetMaxMana();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3778 if ( v48 && !v21->pConditions[14] && !v21->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 v37 = v21->sHealth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 if ( v37 > v21->GetMaxHealth() / 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 v21->sHealth = v37 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 v38 = v21->sMana;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 if ( v38 > v21->GetMaxMana() / 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 v21->sMana = v38 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 if ( v46 && !v21->pConditions[14] && !v21->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 v39 = v21->sHealth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 if ( v39 > v21->GetMaxHealth() / 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 v21->sHealth = v39 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 v40 = v21->sMana;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 if ( v40 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 v21->sMana = v40 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 if ( v49 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 result = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 pParty->uLastRegenerationTime = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 if ( !viewparams->bRedrawGameUI )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 result = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 viewparams->bRedrawGameUI = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3812 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3814 // 493938: using guessed type char var_22C[400];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3815
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3816
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3817
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3818 //----- (00493F79) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3819 int sub_493F79(stru351 *_this, __int64 a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 signed __int64 v2; // ST2C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 signed __int64 v3; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 signed __int64 v4; // ST1C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 unsigned __int64 v5; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3825 unsigned int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3828 v2 = (signed __int64)((double)a2 * 0.234375);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 v3 = v2 / 60 / 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 v5 = (unsigned int)v3 / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 v6 = (unsigned int)(v5 / 7) >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 _this->field_0 = v2 % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 _this->field_4 = v2 / 60 % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3835 _this->field_8 = v4 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 _this->field_10 = v5 / 7 & 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 _this->field_C = (unsigned int)v5 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 result = v6 / 0xC + 1168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 _this->field_14 = v6 % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 _this->field_18 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3841 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3844
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 //----- (00494035) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 void __cdecl _494035_timed_effects__water_walking_damage__etc()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 signed __int64 v0; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 signed __int64 v1; // ST30_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 signed __int64 v2; // ST38_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 unsigned __int64 v3; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 unsigned int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3856 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3857 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3858 Player *v7; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3859 char *v8; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3860 Player *pPlayer; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3861 void *v10; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 unsigned int v11; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 signed int v12; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 Player *v13; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 Player *v14; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 double v15; // st7@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 Player **v16; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 Player *v17; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 double v18; // st7@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 float v19; // ST28_4@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 double v20; // ST38_8@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 Player *v21; // esi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3873 signed int v22; // edi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3874 int v23; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 int v24; // ecx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 int v25; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 int v26; // ecx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 int v27; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3879 int v28; // ecx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3880 int v29; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3881 int v30; // ecx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 int v31; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 int v32; // ecx@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 int v33; // eax@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 int v34; // ecx@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3886 int v35; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 int v36; // ecx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 int v37; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 int v38; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 int v39; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 int v40; // ecx@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 int v41; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 int v42; // ecx@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 bool v43; // ebx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 SpellBuff *v44; // edi@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 signed int v45; // ebp@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 bool v46; // edi@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3898 SpellBuff *v47; // esi@113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3899 Player **v48; // esi@119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 signed int v49; // edi@121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3901 char *v50; // esi@122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 signed int v51; // edx@128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 signed int v52; // ecx@130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 int v53; // eax@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 Player *v54; // eax@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 unsigned int v55; // [sp-8h] [bp-38h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3907 unsigned int v56; // [sp-8h] [bp-38h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 int v57; // [sp-4h] [bp-34h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3909 int v58; // [sp-4h] [bp-34h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3910 int v59; // [sp-4h] [bp-34h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 unsigned int v60; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 unsigned int v61; // [sp+14h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3913 Player **v62; // [sp+14h] [bp-1Ch]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 unsigned int a2; // [sp+18h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3915 signed int a2a; // [sp+18h] [bp-18h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3916 signed int v65; // [sp+1Ch] [bp-14h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 a2 = pParty->uCurrentHour;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 v61 = pParty->uDaysPlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 v60 = pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 pParty->uTimePlayed += (signed int)pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 v0 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 v1 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 v0 /= 60i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 v2 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3926 v3 = (unsigned int)v0 / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 v4 = (unsigned int)(v3 / 7) >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 pParty->uCurrentTimeSecond = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 pParty->uCurrentMinute = v1 % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 pParty->uCurrentMonthWeek = v3 / 7 & 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 pParty->uCurrentHour = v2 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 pParty->uDaysPlayed = (unsigned int)v3 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 pParty->uCurrentMonth = v4 % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 pParty->uCurrentYear = v4 / 0xC + 1168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 if ( pParty->uCurrentHour >= 3 && ((signed int)a2 < 3 || (unsigned int)v3 % 0x1C > v61) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 pParty->pHirelings[0].bHasUsedTheAbility = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 pParty->pHirelings[1].bHasUsedTheAbility = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 v6 = (char *)&pNPCStats->pNewNPCData[0].bHasUsedTheAbility;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 *(int *)v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 v6 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 while ( v5 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 ++pParty->field_764;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 if ( pParty->field_764 > 1u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 v7 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 v7->SetCondition(1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 while ( (signed int)v7 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 if ( pParty->uNumFoodRations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 Party::TakeFood(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3965 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 v8 = (char *)&pParty->pPlayers[0].sHealth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3970 *(int *)v8 = *(int *)v8 / ((unsigned __int8)pParty->field_764 + 1) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3971 v8 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 while ( (signed int)v8 < (signed int)&pParty->field_871C[567] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3975 if ( pParty->field_764 > 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3977 pPlayer = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 pPlayer->Zero();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3981 if ( !(pPlayer->pConditions[15] | pPlayer->pConditions[16] | pPlayer->pConditions[14]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 if ( rand() % 100 < 5 * (unsigned __int8)pParty->field_764 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 v57 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 v55 = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3988 pPlayer->SetCondition(v55, v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3989 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 if ( rand() % 100 < 10 * (unsigned __int8)pParty->field_764 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 v57 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 v55 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 ++pPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4001 while ( (signed int)pPlayer < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4005 pOutdoor->SetFog();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 v10 = &pParty->pPlayers[0].uNumDivineInterventionCastsThisDay;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4007 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 memset(v10, 0, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 v10 = (char *)v10 + 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 while ( (signed int)v10 < (signed int)&pParty->field_871C[694] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4014 v11 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 if ( pParty->uFlags & 4 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 pParty->field_6FC = LODWORD(pParty->uTimePlayed) + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4020 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 if ( pPlayers[v12]->WearsItem(516, 3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 || v13->HasEnchantedItemEquipped(71)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 || (signed __int64)v13->pPlayerBuffs[23].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4030 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 if ( !sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 v14 = pPlayers[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034 v15 = (double)pPlayers[v12]->GetMaxHealth() * 0.1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 v14->ReceiveDamage((signed __int64)v15, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 if ( pParty->uFlags & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 strcpy(GameUI_StatusBar_TimedString, pGlobalTXT_LocalizationStrings[660]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4039 GameUI_StatusBar_TimedStringTimeLeft = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 v13 = pPlayers[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 v13->PlayEmotion(37, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 if ( v12 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 v11 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4055 if ( pParty->uFlags & 0x200 && pParty->field_6FC < (signed __int64)__PAIR__(HIDWORD(pParty->uTimePlayed), v11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 pParty->field_6FC = v11 + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 v16 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 v17 = *v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 v18 = (double)(*v16)->GetMaxHealth() * 0.1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 v17->ReceiveDamage((signed __int64)v18, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 if ( pParty->uFlags & 0x200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 strcpy(GameUI_StatusBar_TimedString, pGlobalTXT_LocalizationStrings[661]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 GameUI_StatusBar_TimedStringTimeLeft = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 while ( (signed int)v16 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4074 _493938_regenerate();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 v65 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4076 a2a = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 if ( pParty->uFlags2 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4079 v19 = (double)(signed int)v60 * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4080 v20 = v19 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4081 a2a = LODWORD(v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4082 if ( SLODWORD(v20) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4083 a2a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 v62 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4088 v21 = *v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4089 if ( (*v62)->uTimeToRecovery )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4090 v21->Recover(a2a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 v22 = v21->sHealth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 if ( v21->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) + v22 + v21->uEndurance >= 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 || (signed __int64)v21->pPlayerBuffs[11].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4095 if ( v22 >= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4096 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 v56 = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4100 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4102 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4103 v56 = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 v21->SetCondition(v56, v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4106 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 v23 = (int)&v21->field_E0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4108 if ( v21->field_E0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4109 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4110 v24 = *(int *)v23 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 if ( v24 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4113 *(int *)v23 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4115 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 *(int *)v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4118 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4121 v25 = (int)&v21->field_E4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 if ( v21->field_E4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4124 v26 = *(int *)v25 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 if ( v26 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4127 *(int *)v25 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4131 *(int *)v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 v27 = (int)&v21->field_E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136 if ( v21->field_E8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138 v28 = *(int *)v27 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139 if ( v28 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 *(int *)v27 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4143 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145 *(int *)v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4149 v29 = (int)&v21->field_EC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 if ( v21->field_EC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 v30 = *(int *)v29 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 if ( v30 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 *(int *)v29 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159 *(int *)v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163 v31 = (int)&v21->field_F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164 if ( v21->field_F0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 v32 = *(int *)v31 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4167 if ( v32 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 *(int *)v31 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4173 *(int *)v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4174 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4177 v33 = (int)&v21->field_F4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4178 if ( v21->field_F4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4180 v34 = *(int *)v33 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4181 if ( v34 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4183 *(int *)v33 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 *(int *)v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 v35 = (int)&v21->field_F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 if ( v21->field_F8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 v36 = *(int *)v35 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 if ( v36 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 *(int *)v35 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4201 *(int *)v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4205 v37 = (int)&v21->field_FC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 if ( v21->field_FC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 v38 = *(int *)v37 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4209 if ( v38 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 *(int *)v37 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4213 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 *(int *)v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4219 v39 = (int)&v21->field_100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4220 if ( v21->field_100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 v40 = *(int *)v39 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 if ( v40 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 *(int *)v39 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229 *(int *)v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 v41 = (int)&v21->field_104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234 if ( v21->field_104 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 v42 = *(int *)v41 - v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4237 if ( v42 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 *(int *)v41 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 *(int *)v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 if ( v21->pConditions[2] | v21->pConditions[12] | v21->pConditions[13] | v21->pConditions[14] | v21->pConditions[15] | v21->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 --v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 v43 = (signed __int64)v21->pPlayerBuffs[7].uExpireTime > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 v44 = v21->pPlayerBuffs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 v45 = 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254 v44->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 ++v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 --v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4258 while ( v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 if ( v43 && (signed __int64)v21->pPlayerBuffs[7].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 v21->SetCondition(1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4261 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 while ( (signed int)v62 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4264 v46 = (signed __int64)pParty->pPartyBuffs[8].uExpireTime > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 v47 = pParty->pPartyBuffs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 if ( v47->_4585CA(pParty->uTimePlayed) == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 ++v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 while ( (signed int)v47 < (signed int)pParty->pPlayers );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 if ( v46 && (signed __int64)pParty->pPartyBuffs[8].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 v48 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 (*v48)->SetCondition(1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4279 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281 while ( (signed int)v48 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283 v49 = (signed int)dword_4EE07C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 v50 = (char *)&pParty->pPartyBuffs[*(int *)v49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287 if ( *(_QWORD *)v50 > 0i64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289 if ( !(v50[15] & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 if ( !pPlayers[(unsigned __int8)v50[14]]->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 ((SpellBuff *)v50)->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 if ( *(int *)v49 == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 v49 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4301 while ( v49 < (signed int)&unk_4EE084 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 v51 = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 if ( v65 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4304 goto LABEL_135;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4307 v52 = (signed int)&pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 v53 = *(int *)v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 if ( *(_QWORD *)(*(int *)v52 + 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 v52 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 if ( v52 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 goto LABEL_135;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 *(int *)(v53 + 16) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 *(int *)(v53 + 20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 v51 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 LABEL_135:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4322 && (!v51 || dword_5C35C0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 uGameState = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4325 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 v54 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330 if ( v54->pConditions[2]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 || v54->pConditions[12]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 || v54->pConditions[13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333 || v54->pConditions[14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 || v54->pConditions[15]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335 || v54->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338 uActiveCharacter = pParty->GetNextActiveCharacter();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 //----- (00494820) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 unsigned int __fastcall sub_494820(unsigned int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 signed int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 v1 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 if ( a1 % 0x18 >= 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 v1 = 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 return v1 - a1 % 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 //----- (00494836) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 int stru339_spell_sound::_494836(int uSoundID, int a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 stru339_spell_sound *v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 int *v6; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 int v8; // [sp+Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 int v9; // [sp+10h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 int a2a; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 result = word_4EE088_sound_ids[uSoundID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 v5 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 a2a = word_4EE088_sound_ids[uSoundID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 v6 = this->pSoundsOffsets;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 v7 = a2a++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 result = pSoundList->LoadSound(v7, (char *)v5 + v3, 44744 - v3, &v8, a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 if ( !result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 a6 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4382 result = v8 + 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4383 *v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4384 v3 += result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 *(v6 - 2) = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 while ( v9 < 2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 //----- (00494AED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 unsigned int PlayerFrameTable::GetFrameIdBy_field0(int uField0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 unsigned int _uNumFrames; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 PlayerFrame *v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 _uNumFrames = this->uNumFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 if ( (signed int)this->uNumFrames <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 v4 = this->pFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 while ( v4->uSequenceID != uField0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 if ( (signed int)result >= (signed int)_uNumFrames )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 //----- (00494B10) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 PlayerFrame *PlayerFrameTable::GetFrameBy_x(unsigned int uFramesetID, unsigned int uFrameID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 unsigned int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429 PlayerFrame *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430 PlayerFrame *v5; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431 __int16 v6; // dx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432 int v7; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433 char *i; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434 int v9; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435 PlayerFrame *result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437 v3 = uFramesetID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438 v4 = this->pFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439 v5 = &v4[uFramesetID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440 if ( v5->uFlags & 1 && (v6 = v5->uAnimLength) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442 v7 = ((signed int)uFrameID >> 3) % (unsigned __int16)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443 for ( i = (char *)&v5->uAnimTime; ; i += 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 v9 = *(short *)i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 if ( v7 <= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 v7 -= v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 result = &v4[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455 result = &v4[uFramesetID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 //----- (00494B5E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 PlayerFrame *PlayerFrameTable::GetFrameBy_y(int *a2, int *a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 PlayerFrameTable *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465 int v6; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 v4 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 v5 = a4 + *a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 if ( v5 < 8 * this->pFrames[*a2].uAnimTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 *a3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4475 v6 = rand() % 4 + 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4476 *a2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 *a3 = 8 * v5 % v4->pFrames[v6].uAnimTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 return &v4->pFrames[*a2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4481
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4482 //----- (00494BC3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483 void PlayerFrameTable::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 PlayerFrameTable *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 auto Str = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 v1 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 v2 = fopen("data\\dpft.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 Abortf("Unable to save dpft.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4496 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4497 fwrite(v1->pFrames, 0xAu, v1->uNumFrames, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4501 //----- (00494C0F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4502 void PlayerFrameTable::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 uNumFrames = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 pFrames = (PlayerFrame *)pAllocator->AllocNamedChunk(pFrames, 10 * uNumFrames, "P Frames");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 memcpy(pFrames, (char *)pSerialized + 4, 10 * uNumFrames);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 //----- (00494C5A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 int PlayerFrameTable::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 PlayerFrameTable *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4515 void *v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4516 FILE *v6; // ST0C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 __int16 v8; // ax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519 const char *v9; // ST10_4@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4520 unsigned __int16 v10; // ax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4521 const char *v11; // ST0C_4@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4522 int j; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 int v13; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524 int v14; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 int v15; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 int v16; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527 signed int k; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4528 PlayerFrame *v18; // edx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 int v19; // esi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4530 int l; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 char Buf; // [sp+Ch] [bp-2F8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 FrameTableTxtLine v23; // [sp+200h] [bp-104h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4533 FrameTableTxtLine v24; // [sp+27Ch] [bp-88h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 int v25; // [sp+2F8h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 int v26; // [sp+2FCh] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 FILE *File; // [sp+300h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 int Argsa; // [sp+30Ch] [bp+8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4539 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4540 //TileTable::dtor((TileTable *)this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4541 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 Abortf("PlayerFrameTable::load - Unable to open file: %s.", Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4554 if ( v24.field_0 && *v24.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4556 if ( v24.field_0 < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 Abortf("PlayerFrameTable::load, too few arguments, %s line %i.", Args, v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 v4 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 v2->uNumFrames = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 v5 = pAllocator->AllocNamedChunk(v2->pFrames, 10 * v4, "P Frames");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 v2->pFrames = (PlayerFrame *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 Abortf("PlayerFrameTable::load - Out of Memory!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 v6 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 v2->uNumFrames = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 fseek(v6, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 if ( v24.field_0 && *v24.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 v8 = atoi(v24.pProperties[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 v9 = v24.pProperties[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 v2->pFrames[v2->uNumFrames].uSequenceID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 v10 = atoi(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 v11 = v24.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 v2->pFrames[v2->uNumFrames].uTextureID = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 v2->pFrames[v2->uNumFrames].uAnimTime = atoi(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 v2->pFrames[v2->uNumFrames].uAnimLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 v2->pFrames[v2->uNumFrames].uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588 for ( j = 3; j < v24.field_0; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 if ( !_strcmpi(v24.pProperties[j], "New") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592 v13 = (int)&v2->pFrames[v2->uNumFrames].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593 *(char *)v13 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 ++v2->uNumFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 if ( (signed int)(v2->uNumFrames - 1) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 v16 = (int)&v2->pFrames[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 if ( !(*(char *)(v16 + 18) & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4608 *(char *)(v16 + 8) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612 while ( v14 < (signed int)(v2->uNumFrames - 1) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 for ( k = 0; k < (signed int)v2->uNumFrames; *(short *)(Argsa + 6) = v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 v18 = v2->pFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 Argsa = (int)&v18[k];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 v19 = *(short *)(Argsa + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4619 if ( *(char *)(Argsa + 8) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 ++k;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4622 for ( l = (int)&v18[k]; *(char *)(l + 8) & 1; l += 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 v19 += *(short *)(l + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 ++k;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4627 LOWORD(v19) = v18[k].uAnimTime + v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4629 ++k;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4631 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634 //----- (00494F3A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 unsigned int IconFrameTable::FindIcon(const char *pIconName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4637 IconFrameTable *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4638 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 unsigned int uID; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 unsigned int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 uID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 if ( (signed int)this->uNumIcons <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647 LABEL_4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652 while ( _strcmpi(pIconName, v2->pIcons[v3].pAnimationName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 ++uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4655 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4656 if ( (signed int)uID >= (signed int)v2->uNumIcons )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 goto LABEL_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 result = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4662 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 //----- (00494F70) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4665 IconFrame *IconFrameTable::GetFrame(unsigned int uIconID, unsigned int uFrameID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 IconFrame *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4668 IconFrame *v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 __int16 v5; // dx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 int v6; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4671 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672 char *i; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4673 int v9; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 IconFrame *result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 v3 = this->pIcons;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 v4 = &v3[uIconID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 if ( v4->uFlags & 1 && (v5 = v4->uAnimLength) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 v6 = ((signed int)uFrameID >> 3) % (unsigned __int16)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 v7 = uIconID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 for ( i = (char *)&v4->uAnimTime; ; i += 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 v9 = *(short *)i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 if ( v6 <= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4686 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4687 v6 -= v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4690 result = &v3[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694 result = &v3[uIconID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4698
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 //----- (00494FBF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 void IconFrameTable::InitializeAnimation(unsigned int uIconID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702 IconFrameTable *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 unsigned int v3; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704 const char *i; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 IconFrame *v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 if ( (signed int)uIconID <= (signed int)this->uNumIcons && (uIconID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710 v3 = uIconID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711 for ( i = this->pIcons[uIconID].pTextureName; ; i = v5[v3].pTextureName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713 v2->pIcons[v3].uTextureID = pIcons_LOD->LoadTexture(i, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714 v5 = v2->pIcons;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715 if ( !(v5[v3].uFlags & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 //----- (0049500A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 void IconFrameTable::ToFile()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725 IconFrameTable *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726 FILE *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 FILE *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729 auto Str = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4731 v1 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 v2 = fopen("data\\dift.bin", "wb");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4734 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735 Abortf("Unable to save dift.bin!");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 fwrite(v1, 4u, 1u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4737 fwrite(v1->pIcons, 0x20u, v1->uNumIcons, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 fclose(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741 //----- (00495056) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 void IconFrameTable::FromFile(void *pSerialized)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 uNumIcons = *(int *)pSerialized;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 pIcons = (IconFrame *)pAllocator->AllocNamedChunk(pIcons, 32 * uNumIcons, "I Frames");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 memcpy(pIcons, (char *)pSerialized + 4, 32 * uNumIcons);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 //----- (0049509D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 int IconFrameTable::FromFileTxt(const char *Args)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 IconFrameTable *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 FILE *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 void *v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 FILE *v6; // ST0C_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 char *i; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 const char *v8; // ST00_4@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 int v9; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760 int v10; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 int v11; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 signed int j; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 IconFrame *v14; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 int v15; // esi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4766 int k; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 signed int result; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4768 char Buf; // [sp+Ch] [bp-2F8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4769 FrameTableTxtLine v19; // [sp+200h] [bp-104h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 FrameTableTxtLine v20; // [sp+27Ch] [bp-88h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771 int v21; // [sp+2F8h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 int v22; // [sp+2FCh] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773 FILE *File; // [sp+300h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4774 int Argsa; // [sp+30Ch] [bp+8h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 //TileTable::dtor((TileTable *)this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 v3 = fopen(Args, "r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 File = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 Abortf("IconFrameTable::load - Unable to open file: %s.", Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 v22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785 if ( fgets(&Buf, 490, v3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4791 if ( v20.field_0 && *v20.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4793 if ( v20.field_0 < 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 Abortf("IconFrameTable::loadText, too few arguments, %s line %i.", Args, v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 while ( fgets(&Buf, 490, File) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 v4 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4802 v2->uNumIcons = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4803 v5 = pAllocator->AllocNamedChunk(v2->pIcons, 32 * v4, "I Frames");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4804 v2->pIcons = (IconFrame *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4805 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 v6 = File;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4808 v2->uNumIcons = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 fseek(v6, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4812 *strchr(&Buf, 10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814 if ( v20.field_0 && *v20.pProperties[0] != 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 strcpy(v2->pIcons[v2->uNumIcons].pAnimationName, v20.pProperties[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817 strcpy(v2->pIcons[v2->uNumIcons].pTextureName, v20.pProperties[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818 v8 = v20.pProperties[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 v2->pIcons[v2->uNumIcons].uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 if ( !_strcmpi(v8, "new") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 v9 = (int)&v2->pIcons[v2->uNumIcons].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 *(char *)v9 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 v2->pIcons[v2->uNumIcons].uAnimTime = atoi(v20.pProperties[3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 v2->pIcons[v2->uNumIcons].uAnimLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 v2->pIcons[v2->uNumIcons++].uTextureID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 if ( (signed int)(v2->uNumIcons - 1) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 v12 = (int)&v2->pIcons[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4838 if ( !(*(char *)(v12 + 60) & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 *(char *)(v12 + 28) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4840 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843 while ( v10 < (signed int)(v2->uNumIcons - 1) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 for ( j = 0; j < (signed int)v2->uNumIcons; *(short *)(Argsa + 26) = v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 v14 = v2->pIcons;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 Argsa = (int)&v14[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 v15 = *(short *)(Argsa + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 if ( *(char *)(Argsa + 28) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4852 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4853 for ( k = (int)&v14[j]; *(char *)(k + 28) & 1; k += 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4855 v15 += *(short *)(k + 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4856 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4858 LOWORD(v15) = v14[j].uAnimTime + v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4860 ++j;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866 fclose(File);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 //----- (00495366) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 char *__fastcall sub_495366(unsigned __int8 a1, unsigned __int8 a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4878 int v3; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4879 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4880 int v5; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881 signed int v7; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 signed int v8; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883 int **v9; // [sp+14h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4884 signed int v10; // [sp+18h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4885 unsigned __int8 v11; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4886
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891 if ( dword_AE336C == a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893 v3 = dword_AE3370;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 dword_AE336C = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4900 if ( (signed int)pNPCStats->uNumNPCNames[v4] <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4901 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4902 v9 = (int **)((char *)pNPCStats->pNPCNames + v4 * 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4903 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4905 v5 = tolower(*(char *)*v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4906 if ( v5 == tolower(v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4909 v7 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4911 v8 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 v9 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916 while ( v10 < (signed int)pNPCStats->uNumNPCNames[v4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 if ( v8 && v8 != v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918 v3 = v8 + rand() % (v7 - v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 v3 = rand() % (signed int)pNPCStats->uNumNPCNames[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4923 dword_AE3370 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4924 return pNPCStats->pNPCNames[0][v11 + 2 * v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4926 // AE336C: using guessed type int dword_AE336C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 // AE3370: using guessed type int dword_AE3370;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 //----- (00495430) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 char *__fastcall GetReputationString(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 char *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4934 if ( a1 < 25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4936 if ( a1 < 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4938 if ( a1 < -5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4940 result = pGlobalTXT_LocalizationStrings[402];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4941 if ( a1 < -24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4942 result = pGlobalTXT_LocalizationStrings[434];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4944 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4946 result = pGlobalTXT_LocalizationStrings[399];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4949 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4951 result = pGlobalTXT_LocalizationStrings[392];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956 result = pGlobalTXT_LocalizationStrings[379];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4960
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4961 //----- (00495461) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4962 char *__fastcall sub_495461(char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, __int64 *a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964 unsigned __int8 v6; // bl@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4965 Player *pPlayer; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4966 NPCData *v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4967 size_t v10; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4968 char *v11; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4969 int v12; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970 ItemGen *v13; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4971 char v14; // cl@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 char *v15; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 int v16; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4974 int v17; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 signed __int64 v18; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4976 unsigned int v19; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 unsigned __int8 *v20; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4978 int v21; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4979 __int16 v22; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4980 int v23; // edx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 int v24; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982 int v25; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4983 float *v26; // esi@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4984 float v27; // ST18_4@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4985 signed int v28; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4986 int v29; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4987 float v30; // ST18_4@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 signed int v31; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989 float v32; // ST18_4@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4990 signed int v33; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 double v34; // st7@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 float v35; // ST18_4@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 signed int v36; // eax@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 float *v37; // esi@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 float v38; // ST18_4@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 int v39; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 float v40; // ST18_4@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 int v41; // eax@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999 float v42; // ST18_4@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 int v43; // eax@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001 float v44; // ST18_4@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 int v45; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 const char *v46; // eax@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 unsigned int v47; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 float v48; // ST18_4@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 __int64 v49; // ST14_8@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5007 int v50; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 int v51; // eax@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5009 Player *v52; // eax@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 int v53; // [sp-4h] [bp-13Ch]@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 int v54; // [sp+0h] [bp-138h]@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 __int16 v55[56]; // [sp+10h] [bp-128h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 stru351 v56; // [sp+80h] [bp-B8h]@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 stru351 v57; // [sp+9Ch] [bp-9Ch]@115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 char a1[100]; // [sp+B8h] [bp-80h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 unsigned int v59; // [sp+11Ch] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 size_t v60; // [sp+120h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 Player *v61; // [sp+124h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 char *Str; // [sp+128h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 int v63; // [sp+12Ch] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 int v64; // [sp+130h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 NPCData *v65; // [sp+134h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5024 v6 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 Str = lpsz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026 if ( IsBadStringPtrA(lpsz, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 return "Invalid String Passed";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 v60 = strlen(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 a1[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5030 pPlayer = &pParty->pPlayers[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 v59 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032 v61 = pPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 memset(pTmpBuf2, 0, 0x7D0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 if ( dword_5C35D4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 v9 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037 v9 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 v65 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041 if ( (signed int)v60 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043 v11 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5044 v12 = v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 v13 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048 v14 = Str[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5049 if ( v14 == 37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5050 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051 pTmpBuf2[v10++] = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 LABEL_119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 v64 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 if ( v12 >= (signed int)v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 return pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 v15 = &Str[v12 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 v16 = (unsigned __int8)Str[v12 + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060 v17 = v16 + 10 * (unsigned __int8)*v15 - 528;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 if ( v17 <= 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063 if ( v17 != 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065 switch ( v16 + 10 * (unsigned __int8)*v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5067 case 0x211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068 v11 = v65->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5069 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070 case 0x212:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071 v11 = pPlayer->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073 case 0x213:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074 case 0x219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075 if ( v65->uSex )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076 v11 = pGlobalTXT_LocalizationStrings[384];// "her"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 v11 = pGlobalTXT_LocalizationStrings[383];// "his"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 case 0x215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 v18 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 v11 = pGlobalTXT_LocalizationStrings[397];// "evening"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 if ( SHIDWORD(v18) <= 0 && SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 5 && SHIDWORD(v18) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 if ( SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 0xB )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 if ( v18 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 v11 = pGlobalTXT_LocalizationStrings[396];// "day"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5092 v11 = pGlobalTXT_LocalizationStrings[395];// "morning"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5095 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096 case 0x216:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 if ( pPlayer->uSex )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098 v11 = pGlobalTXT_LocalizationStrings[387];// "lady"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 v11 = pGlobalTXT_LocalizationStrings[385];// "sir"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102 case 0x217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 if ( pPlayer->uSex )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5105 v11 = pGlobalTXT_LocalizationStrings[386];// "Sir"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5106 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5107 case 0x218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5108 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5110 v20 = (unsigned __int8 *)v61->field_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5111 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5113 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[v19]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 v21 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5116 v22 = word_4EE150[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5117 ++v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5118 v55[v21] = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 while ( v19 < 28 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5123 if ( v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125 v23 = rand() % v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 v24 = dword_A74CDC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 if ( dword_A74CDC == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5129 v24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 dword_A74CDC = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5132 v11 = (char *)dword_723E80_award_related[2 * v55[v24]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5134 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5135 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5136 v11 = (char *)pNPCTopics[55].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5138 pPlayer = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5139 v13 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5140 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5141 case 0x21A:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 if ( pPlayer->uSex )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 v11 = pGlobalTXT_LocalizationStrings[389];// "Lady"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5146 v11 = pGlobalTXT_LocalizationStrings[388];// "Lord"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5148 case 0x21B:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 v25 = GetPartyReputation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 case 0x21C:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 v25 = v65->rep;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 if ( v25 >= 25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5156 v11 = pGlobalTXT_LocalizationStrings[379];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5158 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5160 if ( v25 < 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 if ( v25 >= -5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 v11 = pGlobalTXT_LocalizationStrings[399];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 if ( v25 < -24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 v11 = pGlobalTXT_LocalizationStrings[434];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 v11 = pGlobalTXT_LocalizationStrings[402];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5174 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 v11 = pGlobalTXT_LocalizationStrings[392];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5179 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5180 case 0x21D:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5181 v11 = sub_495366(pPlayer->pName[0], pPlayer->uSex);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183 case 0x21E:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185 case 0x214:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5190 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5192 v11 = pGlobalTXT_LocalizationStrings[393];// "daughter"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193 LABEL_118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 strcat(pTmpBuf2, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 v10 = strlen(pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5196 v64 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5197 v12 = v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5198 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5200 if ( v17 <= 29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202 if ( v17 == 29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5204 //v34 = p2DEvents_minus1__20[13 * (signed int)a4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5205 v34 = p2DEvents[(signed int)a4 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5209 if ( v16 + 10 * (unsigned __int8)*v15 == 544 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5211 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5212 if ( v65->uSex )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5213 v11 = pGlobalTXT_LocalizationStrings[391];// "sister"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5214 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5215 v11 = pGlobalTXT_LocalizationStrings[390];// "brother"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5216 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5218 if ( v16 + 10 * (unsigned __int8)*v15 == 545 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5220 v29 = *(&pNPCStats->field_13A58 + 5 * v65->uProfession) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5221 goto LABEL_91;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5223 if ( v16 + 10 * (unsigned __int8)*v15 == 551 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5225 v47 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5226 if ( v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5227 v11 = pMapStats->pInfos[v47].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5228 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5229 v11 = pGlobalTXT_LocalizationStrings[394];// "Unknown"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5230 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5232 if ( v16 + 10 * (unsigned __int8)*v15 == 552 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5234 v46 = v13->GetDisplayName();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5235 sprintfex(a1, format_4E2D80, v59, v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5236 LABEL_117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5237 v11 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5238 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5240 if ( v16 + 10 * (unsigned __int8)*v15 == 553 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5242 //v37 = &p2DEvents_minus1__20[13 * (signed int)a4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5243 v37 = &p2DEvents[(signed int)a4 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5244 v38 = *v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5245 v39 = v13->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5246 v29 = pPlayer->_4B8233(v39, v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5247 switch ( a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5249 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5250 v44 = *v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 v45 = v13->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 v29 = pPlayer->_4B8213(v45, v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5255 v29 = pPlayer->_4B824B(*v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5256 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5257 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5258 v42 = *v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5259 v43 = v13->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5260 v29 = pPlayer->_4B8265(v43, v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5261 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5262 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5263 v40 = *v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5264 v41 = v13->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5265 v29 = pPlayer->_4B8213(v41, v40) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5266 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5268 goto LABEL_98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5270 if ( v16 + 10 * (unsigned __int8)*v15 != 555 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5272 if ( v16 + 10 * (unsigned __int8)*v15 == 556 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5274 //v11 = (char *)p2DEvents_minus1__10[13 * (signed int)a4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5275 v11 = (char *)p2DEvents[(signed int)a4 - 1].pProprieterTitle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5276 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5278 LABEL_108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5279 strncpy(a1, v15, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5280 v51 = atoi(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5281 sprintfex(a1, "%lu", v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5282 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5284 v26 = &p2DEvents[(signed int)a4 - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5285 v27 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5286 v28 = v13->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5287 v29 = pPlayer->_4B8142(v28, v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5288 if ( a5 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5290 v35 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5291 v36 = v13->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5292 v29 = pPlayer->_4B8102(v36, v35);
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
5293 if ( v13->uAttributes & 2 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 LABEL_77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5296 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5297 goto LABEL_98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 goto LABEL_98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 if ( a5 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5303 if ( a5 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5305 v32 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5306 v33 = v13->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5307 v29 = pPlayer->_4B81C3(v33, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5309 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5311 if ( a5 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5313 v30 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5314 v31 = v13->GetValue();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5315 v29 = pPlayer->_4B8102(v31, v30) / 2;
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
5316 if ( v13->uAttributes & 2 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5317 v29 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5318 LABEL_91:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5319 if ( v29 >= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5320 goto LABEL_98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5321 goto LABEL_77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5324 LABEL_98:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5325 sprintfex(a1, "%lu", v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5326 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5328 v34 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5330 v48 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5331 v29 = pPlayer->_4B8179(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5332 goto LABEL_98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5334 if ( v17 != 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5336 switch ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5338 case 31:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5339 v52 = pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5340 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5341 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342 v52 = pPlayers[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5343 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344 case 33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5345 v52 = pPlayers[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348 if ( v17 != 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350 if ( v17 <= 50 || v17 > 70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5351 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352 if ( v16 + 10 * (unsigned __int8)*v15 - 579 >= 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354 HIDWORD(v49) = pParty->field_3C.field_440[2 * v17 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355 LODWORD(v49) = pParty->field_3C.field_440[2 * v17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356 sub_493F79(&v56, v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5357 v54 = v56.field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 v53 = v56.field_C + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 v50 = v56.field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 LABEL_116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 v52 = pPlayers[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367 v11 = v52->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 if ( !a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372 sub_493F79(&v57, *a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5373 v54 = v57.field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5374 v53 = v57.field_C + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 v50 = v57.field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5376 goto LABEL_116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 return pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 //----- (00495B39) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 void __cdecl PlayerCreationUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 Texture *v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 const char *v1; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5386 int v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5387 IconFrame *v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5388 int v4; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5389 GUIButton *v5; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5390 int v6; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 int v7; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5392 char v8; // al@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5393 int v9; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5394 char v10; // sf@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5395 int v11; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5396 void *v12; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5397 int v13; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5398 int v14; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5399 char *v15; // ST14_4@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5400 size_t v16; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 int v17; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5402 enum CHARACTER_RACE v18; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5403 int v19; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5404 int v20; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5405 int v21; // ST0C_4@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5406 int v22; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 int v23; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5408 unsigned int v24; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5409 int v25; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5410 unsigned int v26; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5411 int v27; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5412 unsigned int v28; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5413 int v29; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5414 unsigned int v30; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5415 int v31; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416 unsigned int v32; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417 int v33; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418 unsigned int v34; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 int v35; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5420 unsigned int v36; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5421 enum PLAYER_SKILL_TYPE v37; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5422 int v38; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5423 enum PLAYER_SKILL_TYPE v39; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5424 int v40; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5425 enum PLAYER_SKILL_TYPE v41; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 const char *v42; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5427 char *v43; // ST1C_4@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428 int v44; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429 int v45; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430 enum PLAYER_SKILL_TYPE v46; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431 const char *v47; // edx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 char *v48; // ST1C_4@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 int v49; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434 int v50; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 int v51; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 char *v52; // edi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 char v53; // al@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 int v54; // edi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 int v55; // ST0C_4@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 int v56; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 int v57; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 const char *v58; // ST10_4@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 unsigned int v59; // ST0C_4@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 int v60; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 int v61; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 const char *v62; // ST10_4@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 unsigned int v63; // ST0C_4@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448 int v64; // ST08_4@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 int v65; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 int v66; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 const char *v67; // ST10_4@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 unsigned int v68; // ST0C_4@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 int v69; // ST08_4@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454 int v70; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 int v71; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 const char *v72; // ST10_4@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 unsigned int v73; // ST0C_4@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 int v74; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 int v75; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 const char *v76; // ST10_4@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 unsigned int v77; // ST0C_4@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 int v78; // ST08_4@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 int v79; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 int v80; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 const char *v81; // ST10_4@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 unsigned int v82; // ST0C_4@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 int v83; // ST08_4@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 int v84; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 int v85; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 const char *v86; // ST10_4@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471 unsigned int v87; // ST0C_4@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 int v88; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473 int v89; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 const char *v90; // ST10_4@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 unsigned int v91; // ST0C_4@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 int v92; // ST08_4@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 int v93; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478 int v94; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 const char *v95; // ST10_4@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 unsigned int v96; // ST0C_4@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 int v97; // ST08_4@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 int v98; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 const char *v99; // ST10_4@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 int v100; // ST0C_4@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 int v101; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 enum PLAYER_SKILL_TYPE v102; // edi@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 size_t v103; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 signed int v104; // ecx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 int v105; // ecx@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490 int v106; // edi@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 unsigned int v107; // ST0C_4@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 int v108; // ST08_4@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 int v109; // eax@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 const char *v110; // ST10_4@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 int v111; // ST0C_4@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496 int v112; // eax@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 signed int v113; // edi@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498 int v114; // ST0C_4@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 int v115; // eax@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 const char *v116; // [sp+0h] [bp-170h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501 char Str1[200]; // [sp+10h] [bp-160h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 GUIWindow v118; // [sp+D8h] [bp-98h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 int v119; // [sp+12Ch] [bp-44h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 size_t v120; // [sp+130h] [bp-40h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 int uY; // [sp+134h] [bp-3Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 int v122; // [sp+138h] [bp-38h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 int v123; // [sp+13Ch] [bp-34h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508 void *v124; // [sp+140h] [bp-30h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 int uColor1; // [sp+144h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 int v126; // [sp+148h] [bp-28h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 int uColorGreen; // [sp+14Ch] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 int v128; // [sp+150h] [bp-20h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 int v129; // [sp+154h] [bp-1Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514 int uColorTeal; // [sp+158h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 int uColorWhite; // [sp+15Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516 int uX; // [sp+160h] [bp-10h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 unsigned int v133; // [sp+164h] [bp-Ch]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 int v134; // [sp+168h] [bp-8h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519 char *Str; // [sp+16Ch] [bp-4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 uColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xD1u, 0xBBu, 0x61u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 uColorTeal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xF7u, 0xF7u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 uColorGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 uColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 pRenderer->DrawTextureRGB(0, 0, &stru_506F20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 v0 = pTexture_MAKESKY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2u, pTexture_MAKESKY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos++ - 640, 2u, v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 if ( (signed int)uPlayerCreationUI_SkySliderPos > 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 uPlayerCreationUI_SkySliderPos = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 pRenderer->DrawTextureTransparent(0, 0, pTexture_MAKETOP);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 v1 = pGlobalTXT_LocalizationStrings[51];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->field_2C_focus_id - pGUIWindow_CurrentMenu->field_38)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 / 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 v2 = pFontCChar->AlignText_Center(0x280u, pGlobalTXT_LocalizationStrings[51]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 pGUIWindow_CurrentMenu->DrawText(pFontCChar, v2 + 1, 0, 0, v1, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538 pRenderer->DrawTextureTransparent(17u, 35u, pPlayerPortraits[(char)pParty->pPlayers[0].uFace]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 pRenderer->DrawTextureTransparent(176u, 35u, pPlayerPortraits[(char)pParty->pPlayers[1].uFace]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 pRenderer->DrawTextureTransparent(335u, 35u, pPlayerPortraits[(char)pParty->pPlayers[2].uFace]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 pRenderer->DrawTextureTransparent(494u, 35u, pPlayerPortraits[(char)pParty->pPlayers[3].uFace]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 v3 = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 if ( uPlayerCreationUI_SelectedCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 switch ( uPlayerCreationUI_SelectedCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 case 1u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 v4 = 171;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 case 2u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 v4 = 329;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 case 3u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 v4 = 488;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557 v4 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563 v4 = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 pRenderer->DrawTextureTransparent(v4, 0x1Du, &pIcons_LOD->pTextures[v3->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566 v5 = pGUIWindow_CurrentMenu->GetControl(pGUIWindow_CurrentMenu->field_2C_focus_id);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 pRenderer->DrawTextureTransparent(v5->uZ - 4, v5->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 pRenderer->DrawTextureTransparent(v5->uX - 12, v5->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim-- + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 if ( uPlayerCreationUI_ArrowAnim < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 uPlayerCreationUI_ArrowAnim = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 v6 = LOBYTE(pFontCreate->uFontHeight) - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 v128 = LOBYTE(pFontCreate->uFontHeight) - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 strcpy(Str1, pGlobalTXT_LocalizationStrings[205]);// "Skills"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 v7 = strlen(Str1) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575 v134 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 if ( v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 v8 = toupper((unsigned __int8)Str1[v7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581 v9 = v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 v10 = v134-- - 1 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583 Str1[v9] = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586 v7 = v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 v134 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 uX = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 uY = 3 * v6 + 169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 v122 = 5 * v6 + 169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 v123 = 3 * v6 + 311;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 v129 = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596 Str = pParty->pPlayers[0].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597 v119 = 6 * v6 + 169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600 pGUIWindow_CurrentMenu->DrawText(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 pFontCreate,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 v134 + 73,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 100,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 pClassNames[(unsigned __int8)Str[17]],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 v134 + 77,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611 50u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 *(&pTexture_IC_KNIGHT + ((unsigned int)(unsigned __int8)Str[17] >> 2)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 v11 = pGUIWindow_CurrentMenu->field_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614 if ( v11 && (v12 = pGUIWindow_CurrentMenu->ptr_1C, v12 == v124) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 v13 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 v14 = v13 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 if ( v14 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 v15 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134, 124u, 0, v15, 130, 0);
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
5627 SetCurrentMenuID(MENU_7);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 v120 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 v126 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 if ( strlen((const char *)pKeyActionMap->pPressedKeysBuffer) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640 if ( pKeyActionMap->pPressedKeysBuffer[v133] == ' ' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641 ++v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 ++v133;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 v16 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5645 while ( v133 < v16 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5647 if ( v120 && v126 != v120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648 strcpy(Str, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134, 0x7Cu, 0, Str, 130, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 *((short *)Str + 3323) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5653 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 v17 = pGUIWindow_CurrentMenu->DrawTextInRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 pFontCreate,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5657 159 * (int)v12 + 18,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658 0x7Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 (const char *)pKeyActionMap->pPressedKeysBuffer,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 120,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 pGUIWindow_CurrentMenu->DrawFlashingInputCursor(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664 159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 124,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5666 pFontCreate);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134, 0x7Cu, 0, Str, 130, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673 v18 = ((Player *)(Str - 168))->GetRace();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5674 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5676 v19 = v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5679 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5680 if ( v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5682 if ( v20 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5684 v116 = pGlobalTXT_LocalizationStrings[101];// "Dwarf"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5686 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5688 v116 = pGlobalTXT_LocalizationStrings[106];// "Goblin"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5691 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693 v116 = pGlobalTXT_LocalizationStrings[103];// "Elf"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 v116 = pGlobalTXT_LocalizationStrings[99];// "Human"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 strcpy(pTmpBuf, v116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5701 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5702 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134 + 72, v128 + 12, 0, pTmpBuf, 130, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5703 v21 = uColor1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5704 v22 = pFontCreate->AlignText_Center(0x96u, Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5705 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v22 + uX - 24, 291, v21, Str1, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5706 v23 = ((Player *)(Str - 168))->GetActualMight();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5707 sprintfex(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, v23);// "Might"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 LOWORD(v24) = ((Player *)(Str - 168))->GetStatColor(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5709 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 v25 = ((Player *)(Str - 168))->GetActualIntelligence();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 sprintfex(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 LOWORD(v26) = ((Player *)(Str - 168))->GetStatColor(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 v27 = ((Player *)(Str - 168))->GetActualWillpower();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 sprintfex(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 LOWORD(v28) = ((Player *)(Str - 168))->GetStatColor(2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 v29 = ((Player *)(Str - 168))->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 sprintfex(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 LOWORD(v30) = ((Player *)(Str - 168))->GetStatColor(3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 v31 = ((Player *)(Str - 168))->GetActualAccuracy();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5723 sprintfex(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5724 LOWORD(v32) = ((Player *)(Str - 168))->GetStatColor(4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 v33 = ((Player *)(Str - 168))->GetActualSpeed();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727 sprintfex(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 LOWORD(v34) = ((Player *)(Str - 168))->GetStatColor(5u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5729 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5730 v35 = ((Player *)(Str - 168))->GetActualLuck();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 sprintfex(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732 LOWORD(v36) = ((Player *)(Str - 168))->GetStatColor(6u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 v37 = ((Player *)(Str - 168))->GetSkillIdxByOrder(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735 v38 = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5736 sprintfex(pTmpBuf, "\t%03u%s", v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5737 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5738 v39 = ((Player *)(Str - 168))->GetSkillIdxByOrder(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5739 v40 = pFontCreate->AlignText_Center(0x96u, pSkillNames[v39]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5740 sprintfex(pTmpBuf, "\t%03u%s", v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v128 + 311, uColorWhite, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5742 v41 = ((Player *)(Str - 168))->GetSkillIdxByOrder(2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5743 v42 = pSkillNames[v41];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5744 v43 = pSkillNames[v41];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5745 v133 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5746 v44 = pFontCreate->AlignText_Center(150u, v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5747 sprintfex(pTmpBuf, "\t%03u%s", v44, v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5748 v45 = uColorGreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5749 if ( (signed int)v133 >= 37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5750 v45 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5751 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 v46 = ((Player *)(Str - 168))->GetSkillIdxByOrder(3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 v47 = pSkillNames[v46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 v48 = pSkillNames[v46];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 v133 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 v49 = pFontCreate->AlignText_Center(150u, v47);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 sprintfex(pTmpBuf, "\t%03u%s", v49, v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5758 v50 = uColorGreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5759 if ( (signed int)v133 >= 37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5760 v50 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5761 pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v123, v50, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5762 Str += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5763 v124 = (char *)v124 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5764 v134 += 159;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5765 v129 -= 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 uX += 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5768 while ( (signed int)Str < (signed int)&pParty->pPickedItem.uNumCharges );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5769 strcpy(Str1, pGlobalTXT_LocalizationStrings[41]);// "Class"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5770 v51 = strlen(Str1) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 v134 = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 if ( v51 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 v52 = &Str1[v51];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 v53 = toupper((unsigned __int8)Str1[v51]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 v10 = v134-- - 1 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 *v52 = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782 v51 = v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 v54 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].uClass;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 v55 = uColor1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 v133 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].uClass;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788 v56 = pFontCreate->AlignText_Center(193u, Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v56 + 324, 395, v55, Str1, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790 v57 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 v57 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793 v58 = pClassNames[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 v59 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 v60 = pFontCreate->AlignText_Center(65u, pClassNames[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v60 + 323, 417, v59, v58, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 v61 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 if ( v133 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 v61 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 v62 = pClassNames[12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801 v63 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802 v64 = v128 + 417;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 uColorGreen = v128 + 417;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 v65 = pFontCreate->AlignText_Center(65u, pClassNames[12]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v65 + 323, v64, v63, v62, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 v66 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5807 if ( v133 != 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 v66 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809 v67 = pClassNames[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 v68 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 v69 = 2 * v128 + 417;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812 v126 = 2 * v128 + 417;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5813 v70 = pFontCreate->AlignText_Center(65u, pClassNames[20]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v70 + 323, v69, v68, v67, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815 v71 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816 if ( v133 != PLAYER_CLASS_CLERIC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 v71 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 v72 = pClassNames[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 v73 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 v74 = pFontCreate->AlignText_Center(65u, pClassNames[24]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v74 + 388, 417, v73, v72, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822 v75 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 if ( v133 != 28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 v75 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5825 v76 = pClassNames[28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 v77 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5827 v78 = uColorGreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 v79 = pFontCreate->AlignText_Center(65u, pClassNames[28]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v79 + 388, v78, v77, v76, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5830 v80 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 if ( v133 != PLAYER_CLASS_SORCERER )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5832 v80 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 v81 = pClassNames[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834 v82 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 v83 = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 v84 = pFontCreate->AlignText_Center(65u, pClassNames[32]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v84 + 388, v83, v82, v81, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 v85 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839 if ( v133 != 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840 v85 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841 v86 = pClassNames[16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5842 v87 = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 v88 = pFontCreate->AlignText_Center(65u, pClassNames[16]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v88 + 453, 417, v87, v86, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 v89 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846 if ( v133 != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847 v89 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5848 v90 = pClassNames[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5849 v91 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5850 v92 = uColorGreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5851 v93 = pFontCreate->AlignText_Center(65u, pClassNames[8]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v93 + 453, v92, v91, v90, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853 v94 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 if ( v133 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5855 v94 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5856 v95 = pClassNames[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5857 v96 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5858 v97 = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5859 v98 = pFontCreate->AlignText_Center(65u, pClassNames[4]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5860 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v98 + 453, v97, v96, v95, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5861 v99 = pGlobalTXT_LocalizationStrings[20]; // "Available Skills"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5862 v100 = uColor1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5863 v101 = pFontCreate->AlignText_Center(0xECu, pGlobalTXT_LocalizationStrings[20]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5864 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v101 + 37, 395, v100, v99, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5865 v134 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5866 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5868 v102 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(v134 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5869 strcpy(Str1, pSkillNames[v102]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5870 v103 = strlen(Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5871 v104 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5872 if ( (signed int)v103 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5874 while ( Str1[v104] != 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5876 ++v104;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5877 if ( v104 >= (signed int)v103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5878 goto LABEL_77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5880 Str1[v104] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5882 LABEL_77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5883 uColorGreen = -5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5884 if ( (signed int)v124 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5885 uColorGreen = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5886 v105 = uColorTeal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5887 if ( !pParty->pPlayers[0].pActiveSkills[v102 + 3486 * uPlayerCreationUI_SelectedCharacter] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5888 v105 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5889 v106 = v134 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5890 v107 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5891 v108 = v128 * v134 % 3 + 417;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5892 v109 = pFontCreate->AlignText_Center(100u, Str1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5893 pGUIWindow_CurrentMenu->DrawText(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5894 pFontCreate,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5895 100 * v106 + v109 + uColorGreen + 17,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5896 v108,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5897 v107,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5898 Str1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5899 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5900 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5901 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5902 ++v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5904 while ( v134 < 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5905 v110 = pGlobalTXT_LocalizationStrings[30]; // "Bonus"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5906 v111 = uColor1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5907 v112 = pFontCreate->AlignText_Center(0x5Cu, pGlobalTXT_LocalizationStrings[30]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5908 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v112 + 533, 394, v111, v110, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5909 v113 = PlayerCreation_ComputeAttributeBonus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5910 sprintfex(pTmpBuf, "%d", v113);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5911 v114 = uColorWhite;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5912 v115 = pFontCreate->AlignText_Center(84u, pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5913 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v115 + 530, 410, v114, pTmpBuf, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5914 if ( GameUI_StatusBar_TimedStringTimeLeft > GetTickCount() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5916 v118.str_48 = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5917 if ( v113 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5918 v118.str_48 = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5919 v118.uFrameWidth = 300;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5920 v118.uFrameHeight = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5921 v118.uFrameX = 170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5922 v118.uFrameY = 140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5923 v118.uFrameZ = 469;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5924 v118.uFrameW = 239;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5925 v118._415551(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5927 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5929
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5930 //----- (0049695A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5931 void __cdecl PlayerCreationUI_Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5933 unsigned int v0; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5934 unsigned int v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5935 int v2; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5936 unsigned int v3; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5937 signed int v4; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5938 signed int uControlParam; // [sp+10h] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5939 unsigned int uControlParama; // [sp+10h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5940 unsigned int uControlParamb; // [sp+10h] [bp-Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5941 unsigned int uControlParamc; // [sp+10h] [bp-Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5942 signed int uControlParamd; // [sp+10h] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5943 signed int uX; // [sp+14h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5944 unsigned int uXa; // [sp+14h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5945 unsigned int uXb; // [sp+14h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5946 unsigned int uXc; // [sp+14h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5947 signed int uXd; // [sp+14h] [bp-8h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5948
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5949 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5950 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5951 pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5952 ++pIcons_LOD->uTexturePacksCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5953 if ( !pIcons_LOD->uNumPrevLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5954 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5955 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5956 uPlayerCreationUI_ArrowAnim = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5957 uPlayerCreationUI_SkySliderPos = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5958 uPlayerCreationUI_SelectedCharacter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5959 v0 = LOBYTE(pFontCreate->uFontHeight) - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5960 pTexture_IC_KNIGHT = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_KNIGHT", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5961 pTexture_IC_THIEF = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_THIEF", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5962 pTexture_IC_MONK = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_MONK", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5963 pTexture_IC_PALAD = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_PALAD", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5964 pTexture_IC_ARCH = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_ARCH", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5965 pTexture_IC_RANGER = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_RANGER", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5966 pTexture_IC_CLER = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_CLER", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5967 pTexture_IC_DRUID = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_DRUID", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5968 pTexture_IC_SORC = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_SORC", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5969 pTexture_MAKETOP = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("MAKETOP", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5970 uX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5971 pTexture_MAKESKY = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("MAKESKY", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5972 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5974 sprintfex(pTmpBuf, "%s01", pPlayerPortraitsNames[uX]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5975 v1 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5976 v2 = uX * 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5977 ++uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5978 *(Texture **)((char *)pPlayerPortraits + v2) = &pIcons_LOD->pTextures[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5980 while ( uX < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5981 pTexture_PlayerFaceMask = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("FACEMASK", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5982 pTexture_buttminu = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("buttminu", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5983 pTexture_buttplus = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("buttplus", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5984 pTexture_pressrigh = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("presrigh", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5985 pTexture_presleft = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("presleft", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5986 uControlParam = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5987 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5989 sprintfex(pTmpBuf, "arrowl%d", uControlParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5990 pTextures_arrowl[uControlParam] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5991 sprintfex(pTmpBuf, "arrowr%d", uControlParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5992 v3 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5993 v4 = uControlParam++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5994 pTextures_arrowr[v4] = &pIcons_LOD->pTextures[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5996 while ( uControlParam < 20 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5997 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5998 uControlParama = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5999 uXa = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6000 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6002 pGUIWindow_CurrentMenu->CreateButton(uXa, 120u, 145u, 25u, 1, 0, 0x3Cu, uControlParama, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6003 uXa += 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6004 ++uControlParama;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6006 while ( (signed int)uXa < 640 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6007 pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6008 10u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6009 32u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6010 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6011 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6012 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6013 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6014 0xABu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6015 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6016 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6017 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6018 pTexture_presleft,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6019 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6020 pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6021 169u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6022 32u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6023 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6024 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6025 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6026 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6027 0xABu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6028 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6029 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6030 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6031 pTexture_presleft,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6032 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6033 pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6034 327u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6035 32u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6036 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6037 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6038 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6039 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6040 0xABu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6041 2u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6042 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044 pTexture_presleft,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046 pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047 486u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 32u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053 0xABu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 pTexture_presleft,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 pCreationUI_BtnPressRight[0] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060 74u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 32u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066 0xACu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070 pTexture_pressrigh,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072 pCreationUI_BtnPressRight[1] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 233u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 32u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 0xACu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 pTexture_pressrigh,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6084 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085 pCreationUI_BtnPressRight[2] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6086 391u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 32u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6089 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 0xACu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 2u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096 pTexture_pressrigh,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 pCreationUI_BtnPressRight[3] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 549u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 32u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 0xACu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 pTexture_pressrigh,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 pCreationUI_BtnPressLeft2[0] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112 10u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113 103u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6117 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6118 0x90u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6119 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6120 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6121 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6122 pTexture_presleft,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6123 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6124 pCreationUI_BtnPressLeft2[1] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6125 169u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6126 103u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6127 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6128 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6129 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6130 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6131 0x90u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6132 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6133 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6134 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6135 pTexture_presleft,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6136 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 pCreationUI_BtnPressLeft2[2] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 327u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 103u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6142 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6143 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6144 0x90u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6145 2u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6146 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6147 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6148 pTexture_presleft,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 pCreationUI_BtnPressLeft2[3] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 486u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 103u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6153 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6154 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6155 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6156 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6157 0x90u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6158 3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6159 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6160 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 pTexture_presleft,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 74u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 103u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6166 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6167 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6168 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6169 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6170 0x91u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6171 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6172 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 pTexture_pressrigh,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 233u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6178 103u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6179 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6180 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6181 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6182 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6183 0x91u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6184 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 pTexture_pressrigh,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6189 pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6190 391u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6191 103u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6192 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6193 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6194 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6195 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6196 0x91u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 2u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200 pTexture_pressrigh,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6202 pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6203 549u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6204 103u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6205 11u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6206 13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6207 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6208 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6209 0x91u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 pTexture_pressrigh,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6215 uControlParamb = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6216 uXb = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6217 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6219 pGUIWindow_CurrentMenu->CreateButton(uXb, 308u, 150u, v0, 1, 0, 0x48u, uControlParamb, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6220 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6221 uXb,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6222 v0 + 308,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 150u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 v0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6227 0x49u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6228 uControlParamb,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6229 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6230 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6231 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6232 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6233 uXb,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 2 * v0 + 308,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 150u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 v0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6238 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6239 0x4Au,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 uControlParamb,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6241 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6244 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 uXb,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6246 3 * v0 + 308,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6247 150u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6248 v0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6249 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6250 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 0x4Bu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 uControlParamb,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6256 uXb += 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6257 ++uControlParamb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6259 while ( (signed int)uXb < 640 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6260 pGUIWindow_CurrentMenu->CreateButton(5u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 0, 0x31u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 pGUIWindow_CurrentMenu->CreateButton(163u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 1u, 0x32u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262 pGUIWindow_CurrentMenu->CreateButton(321u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 2u, 0x33u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 pGUIWindow_CurrentMenu->CreateButton(479u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 3u, 0x34u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 uXc = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 uControlParamc = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6266 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6268 pGUIWindow_CurrentMenu->CreateButton(uXc, 169u, 120u, 20u, 1, 0, 0, uControlParamc - 2, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6269 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6270 uXc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6271 v0 + 169,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6272 120u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6273 20u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6274 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6275 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6276 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6277 uControlParamc - 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6278 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6279 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6280 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6281 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6282 uXc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6283 2 * v0 + 169,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6284 120u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6285 20u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6286 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6287 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6288 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6289 uControlParamc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6290 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6291 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6292 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6293 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6294 uXc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6295 3 * v0 + 169,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6296 120u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6297 20u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6298 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6299 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6300 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6301 uControlParamc + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6302 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6303 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6304 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6305 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6306 uXc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6307 4 * v0 + 169,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6308 120u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6309 20u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6310 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6311 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6312 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6313 uControlParamc + 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6314 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6315 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6316 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6317 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6318 uXc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6319 5 * v0 + 169,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6320 120u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6321 20u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6322 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6323 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6324 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6325 uControlParamc + 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6326 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6327 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6328 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6329 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6330 uXc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6331 6 * v0 + 169,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6332 120u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6333 20u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6334 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6335 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6336 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6337 uControlParamc + 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6338 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6339 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6340 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6341 uControlParamc += 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6342 uXc += 158;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6344 while ( (signed int)uControlParamc < 30 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6345 pGUIWindow_CurrentMenu->_41D08F(28, 0, 7, 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6346 pGUIWindow_CurrentMenu->CreateButton(323u, 417u, 65u, v0, 1, 0, 0x41u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6347 pGUIWindow_CurrentMenu->CreateButton(323u, v0 + 417, 65u, v0, 1, 0, 0x41u, 0xCu, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6348 pGUIWindow_CurrentMenu->CreateButton(323u, 2 * v0 + 417, 65u, v0, 1, 0, 0x41u, 0x14u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6349 pGUIWindow_CurrentMenu->CreateButton(388u, 417u, 65u, v0, 1, 0, 0x41u, 0x18u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6350 pGUIWindow_CurrentMenu->CreateButton(388u, v0 + 417, 65u, v0, 1, 0, 0x41u, 0x1Cu, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6351 pGUIWindow_CurrentMenu->CreateButton(388u, 2 * v0 + 417, 65u, v0, 1, 0, 0x41u, 0x20u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6352 pGUIWindow_CurrentMenu->CreateButton(453u, 417u, 65u, v0, 1, 0, 0x41u, 0x10u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6353 pGUIWindow_CurrentMenu->CreateButton(453u, v0 + 417, 65u, v0, 1, 0, 0x41u, 8u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6354 pGUIWindow_CurrentMenu->CreateButton(453u, 2 * v0 + 417, 65u, v0, 1, 0, 0x41u, 4u, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6355 uControlParamd = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6356 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6358 uXd = -5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6359 if ( uControlParamd <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6360 uXd = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6361 pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6362 100 * uControlParamd / 3 + uXd + 17,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6363 v0 * uControlParamd % 3 + 417,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6364 100u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6365 v0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6366 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6367 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6368 0x40u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6369 uControlParamd,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6370 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6371 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6372 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6373 ++uControlParamd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6375 while ( uControlParamd < 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6376 pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6377 580u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6378 431u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6379 51u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6380 39u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6381 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6382 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6383 0x42u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6384 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6385 0xDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6386 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6387 (Texture *)(uTextureID_BUTTMAKE != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6388 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6389 pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6390 527u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6391 431u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6392 51u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6393 39u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6394 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6395 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6396 0x43u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6397 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6398 0x43u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6399 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6400 (Texture *)(uTextureID_BUTTMAKE2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTMAKE2] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6401 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6402 pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6403 523u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6404 393u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6405 20u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6406 35u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6407 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6408 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6409 0x3Fu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6410 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6411 0x2Du,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6412 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6413 pTexture_buttminu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6414 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6415 pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6416 613u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6417 393u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6418 20u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6419 35u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6420 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6421 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6422 0x3Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6423 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6424 0x2Bu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6425 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6426 pTexture_buttplus,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6427 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6428 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6430 // 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6432 //----- (0049750E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6433 void __cdecl DeleteCCharFont()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6435 pAllocator->FreeChunk(pFontCChar);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6436 pFontCChar = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6438
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6439 //----- (00497526) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6440 bool __cdecl PlayerCreationUI_Loop()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 RGBTexture *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6443 UINT v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6444 unsigned int v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 LONG uMouseX; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6446 LONG uMouseY; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6447 GUIButton *v5; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6448 unsigned int v6; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6449 int v7; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6450 signed int v8; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6451 int v9; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6452 char *v10; // ebx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6453 int v11; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6454 signed int v12; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6455 int v13; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 signed int v14; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6457 int v15; // eax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6458 signed int v16; // ecx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6459 unsigned int v18; // [sp-4h] [bp-84h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6460 ItemGen item; // [sp+Ch] [bp-74h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6461 char v20; // [sp+30h] [bp-50h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6462 char v21; // [sp+31h] [bp-4Fh]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6463 __int16 v22; // [sp+4Dh] [bp-33h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6464 char v23; // [sp+4Fh] [bp-31h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6465 MSG Msg; // [sp+50h] [bp-30h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6466 POINT v25; // [sp+6Ch] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6467 bool v26; // [sp+74h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6468 POINT v24; // [sp+78h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6469
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6470 v0 = &stru_506F20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6471 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6472 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6473 stru_506F20.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6474 stru_506F20.Load("makeme.pcx", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6475 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6476 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6477 v2 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6478 pGUIWindow_CurrentMenu->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6479 LABEL_27:
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
6480 SetCurrentMenuID((MENU_STATE)v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6481 while ( GetCurrentMenuID() == MENU_CREATEPARTY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 if ( pAsyncMouse != (void *)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6484 pAsyncMouse->_46B736_consume_click_lists(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6485 uMouseX = pMouse->GetCursorPos(&v24)->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 uMouseY = pMouse->GetCursorPos(&v25)->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6487 v5 = pGUIWindow_CurrentMenu->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6488 if ( v5 != (GUIButton *)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6489 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6490 v6 = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6491 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6493 if ( uMouseX >= (signed int)v5->uX
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6494 && uMouseX <= (signed int)v5->uZ
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6495 && uMouseY >= (signed int)v5->uY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6496 && uMouseY <= (signed int)v5->uW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6498 v7 = v5->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6499 if ( (signed int)v6 < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6501 pMessageQueue_50CBD0->pMessages[v6].eType = (UIMessageType)v5->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6502 v0 = &stru_506F20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6503 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6504 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6505 v6 = pMessageQueue_50CBD0->uNumMessages + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6506 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6508 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6510 v5 = v5->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6512 while ( v5 != (GUIButton *)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6514 while ( PeekMessageA(&Msg, (HWND)v1, v1, v1, PM_REMOVE) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6516 if ( Msg.message == WM_QUIT )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6517 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6518 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6519 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6521 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6523 WaitMessage();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6525 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6527 PlayerCreationUI_Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6528 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6529 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6530 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6531 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6532 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6533 if ( uGameState == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6535 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6537 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6539 if ( uGameState == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6541 uGameState = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6542 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6543 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 v0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6548 pGUIWindow_CurrentMenu->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6549 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6550 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6551 memset(&v21, 0, 0x1Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6552 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6553 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6554 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6556 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6557 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6559 v9 = rand() % 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6560 if ( !*(&v20 + v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6561 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6562 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6564 while ( v8 < 10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6565 if ( v8 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6567 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6568 if ( v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6570 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6571 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6572 while ( *(&v20 + v9) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6575 pParty->field_854[v1++] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6576 *(&v20 + v9) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6578 while ( (signed int)v1 < 32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6579 item.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6580 v10 = (char *)&pParty->pPlayers[0].sResMagicBase;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6581 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6583 v11 = (int)(v10 - 6014);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6584 if ( !*(v10 - 5829) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 *(short *)v10 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6586 *((short *)v10 + 400) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6587 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 v13 = (int)(v10 - 5726);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6589 while ( !*(short *)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6591 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6592 v13 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6593 if ( v12 >= 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6594 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6596 *(char *)(v11 + 6734) = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6597 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6598 pItemsTable->GenerateItem(2, 40, &item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6599 ((Player *)(v10 - 6014))->AddItem2(0xFFFFFFFFu, &item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6600 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6601 v24.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6602 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6604 if ( *(short *)(v11 + 2 * v14 + 264) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6606 switch ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6608 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6609 v18 = 61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6610 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6611 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6612 v18 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6613 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6614 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6615 v18 = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6616 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6617 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6618 v18 = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6619 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6620 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6621 v18 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6622 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6623 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6624 v18 = 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6625 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6626 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6627 v18 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6628 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6629 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6630 v18 = 84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6631 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6632 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6633 v18 = 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6634 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6635 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 v18 = 71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6637 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6639 v18 = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6640 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6641 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6642 ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x191u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6643 *(char *)(v11 + 402) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6644 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6645 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6646 ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x19Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6647 *(char *)(v11 + 413) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6648 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6649 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6650 ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1A7u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6651 *(char *)(v11 + 424) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6652 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6653 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6654 ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1B2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6655 *(char *)(v11 + 435) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6656 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6657 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6658 ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1BDu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659 *(char *)(v11 + 446) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6660 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6661 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6662 ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1C8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6663 *(char *)(v11 + 457) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6664 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6665 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6666 ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0x1D3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6667 *(char *)(v11 + 468) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6668 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6669 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6670 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6671 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6672 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6673 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6674 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6675 ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, 0xDCu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6676 v18 = 5 * (rand() % 3 + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6677 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6678 case 30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6679 v18 = 115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6680 goto LABEL_69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6681 case 31:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6682 v18 = 110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6683 LABEL_69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6684 ((Player *)(v10 - 6014))->AddItem(0xFFFFFFFFu, v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6685 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6686 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6687 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 v15 = v11 + 552;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6690 v16 = 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6691 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6693 if ( *(int *)(v15 - 20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6694 *(int *)v15 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6695 v15 += 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6696 --v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6698 while ( v16 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6699 *(int *)(v11 + 6460) = ((Player *)(v10 - 6014))->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 *(int *)(v11 + 6464) = ((Player *)(v10 - 6014))->GetMaxMana();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6701 v14 = v24.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6703 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 v24.y = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6706 while ( v14 < 37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6707 v10 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 while ( (signed int)v10 < (signed int)((char *)&pParty->field_871C[455] + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6710 pAudioPlayer->StopChannels(-1, -1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6711 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 return v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 //----- (004979D2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 MENU_STATE __cdecl CreditsMenu__Loop()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6722 char *v0; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 char *v1; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 FILE *v2; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6725 unsigned int v3; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 GUIFont *v4; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 GUIFont *v5; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 __int16 v6; // ax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 void *v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6730 unsigned int v8; // ST2C_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 unsigned int v9; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 unsigned int v10; // ST2C_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 unsigned int teal; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 //Texture v12; // [sp+Ch] [bp-130h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6735 //RGBTexture v16; // [sp+54h] [bp-E8h]@1
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6736 //double v15; // [sp+7Ch] [bp-C0h]@9
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737 MSG Msg; // [sp+84h] [bp-B8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6738 int v17; // [sp+A0h] [bp-9Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 int a2; // [sp+A4h] [bp-98h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6740 unsigned int a3; // [sp+A8h] [bp-94h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6741 int v20; // [sp+ACh] [bp-90h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6742 int a4; // [sp+B0h] [bp-8Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6743 int a8; // [sp+F8h] [bp-44h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744 int a7; // [sp+FCh] [bp-40h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 //RGBTexture v21; // [sp+100h] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6746 int a5; // [sp+128h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6747 char *pString; // [sp+12Ch] [bp-10h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6748 char *ptr; // [sp+130h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 GUIFont *pFontQuick; // [sp+134h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6750 GUIFont *pFontCChar; // [sp+138h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6751
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 RGBTexture v16; // [sp+54h] [bp-E8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6753 //RGBTexture::RGBTexture(&v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6754 RGBTexture v21; // [sp+100h] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6755 //RGBTexture::RGBTexture(&v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6756
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 a5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6758 pFontQuick = LoadFont("quick.fnt", "FONTPAL", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6759 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6760 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6761 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6762 ++pIcons_LOD->uTexturePacksCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763 if ( !pIcons_LOD->uNumPrevLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6764 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6765 dword_A74C88 = 0;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6766 pAudioPlayer->PlayMusicTrack(MUSIC_Credits);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6767 v16.Load("mm6title.pcx", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6768 v0 = (char *)pEvents_LOD->LoadRaw("credits.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6769 v1 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6770 ptr = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6771
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6772 Texture v12; // [sp+Ch] [bp-130h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6773 //Texture::Texture(&v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6775 v2 = pEvents_LOD->FindContainer("credits.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6776 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 Abortf(pGlobalTXT_LocalizationStrings[63]); // "Might and Magic VII is having trouble loading files.
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6778 // Please re-install to fix this problem. Note: Re-installing will not destroy your save games."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6779 fread(&v12, 1u, 0x30u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 v3 = v12.uDecompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 if ( !v12.uDecompressedSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6782 v3 = v12.uTextureSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6783 memset(&v12, 0, 0x48u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 v4 = pFontCChar;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 v5 = pFontQuick;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6786 v1[v3] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 v20 = 250;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 a4 = 440;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6789 a2 = 389;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 a3 = 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6791 v21.uWidth = 250;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6792 v6 = v5->GetStringHeight2(v4, v1, (int)&a2, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 v21.uHeight = v6 + 2 * a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6794 v21.uNumPixels = (signed __int16)v21.uWidth * (signed __int16)v21.uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6795 v7 = pAllocator->AllocNamedChunk(v21.pPixels, 2 * v21.uNumPixels, "scrollermap");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796 v8 = v21.uNumPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6797 v21.pPixels = (unsigned __int16 *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6798 v9 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6799 fill_pixels_fast(v9, v21.pPixels, v8);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6800 v21.field_20 = 0;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6801 v21.field_22 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6802 a7 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x70u, 0x8Fu, 0xFEu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6803 a8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xECu, 0xE6u, 0x9Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6804 pString = (char *)operator new(2 * v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6805 strncpy(pString, ptr, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6806 pFontQuick->_44D2FD_prolly_draw_credits_entry(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6807 pFontCChar,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6809 a4 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6810 (signed __int16)v21.uWidth,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6811 (signed __int16)v21.uHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6812 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6814 pString,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6815 v21.pPixels,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 (signed __int16)v21.uWidth);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 strncpy(pString, ptr, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6818 pFontQuick->_44D2FD_prolly_draw_credits_entry(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 pFontCChar,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6820 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6821 a4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 (signed __int16)v21.uWidth,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6823 (signed __int16)v21.uHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 a7,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 a8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6826 pString,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 v21.pPixels,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 (signed __int16)v21.uWidth);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6829 free(pString);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6830 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr);
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6831 pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, 0x71u, 0, 0x1Bu, nullstring, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 9;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6833 SetCurrentMenuID(MENU_Credits);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6834 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 pRenderer->DrawTextureRGB(0, 0, &v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 pRenderer->Clip(a2, a3, a2 + v20, a3 + a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 pRenderer->_4A5D33(a2, a3, 0, 0, &v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 pRenderer->ResetClip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6839 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6840 pString = (char *)0x447A0000;
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6841 //v15 = 1000.0 + 6.7553994e15;
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6842 v17 = floorf(1000.0f + 0.5f);//(v15);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6844 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6845 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6847 while ( PeekMessageA(&Msg, 0, 0, 0, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6849 if ( Msg.message == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6850 Game_DeinitializeAndTerminate(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6851 TranslateMessage(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6852 DispatchMessageA(&Msg);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6856 WaitMessage();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6858 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
6860 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6861 pAsyncMouse->_46B736_consume_click_lists(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6862 if ( dword_A74C88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6864 v16.Load("mm6title.pcx", 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6865 v10 = v21.uNumPixels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6866 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6867 fill_pixels_fast(teal, v21.pPixels, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6868 strncpy(pTmpBuf, ptr, 0x7D0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6869 pFontQuick->_44D2FD_prolly_draw_credits_entry(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6870 pFontCChar,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6871 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6872 a4 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6873 (signed __int16)v21.uWidth,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6874 (signed __int16)v21.uHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6875 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6876 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6877 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6878 v21.pPixels,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6879 (signed __int16)v21.uWidth);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6880 strncpy(pTmpBuf, ptr, 0x7D0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6881 pFontQuick->_44D2FD_prolly_draw_credits_entry(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6882 pFontCChar,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6883 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6884 a4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6885 (signed __int16)v21.uWidth,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6886 (signed __int16)v21.uHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6887 a7,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6888 a8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6889 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6890 v21.pPixels,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6891 (signed __int16)v21.uWidth);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6892 dword_A74C88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6893 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 pRenderer->DrawTextureRGB(0, 0, &v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6895 pRenderer->Clip(a2, a3, a2 + v20, a2 + a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6896 pRenderer->_4A5D33(a2, a3, 0, a5, &v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6897 pRenderer->ResetClip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6898 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6899 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6900 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6901 timeGetTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6903 pRenderer->DrawTextureRGB(0, 0, &v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6904 pRenderer->Clip(a2, a3, a2 + v20, a3 + a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6905 pRenderer->_4A5D33(a2, a3, 0, a5, &v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6906 pRenderer->ResetClip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6907 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6908 ++a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6909 if ( a5 >= (signed __int16)v21.uHeight )
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
6910 SetCurrentMenuID(MENU_MAIN);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6911 timeGetTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6912 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6916 while ( GetCurrentMenuID() == MENU_Credits );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6917 GUI_MainMenuMessageProc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6918 pRenderer->BeginScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6919 GUI_UpdateWindows();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6920 pRenderer->EndScene();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6921 pRenderer->Present();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6922 pAudioPlayer->_4AA258(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6923 pAllocator->FreeChunk(ptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 pAllocator->FreeChunk(pFontQuick);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6925 pAllocator->FreeChunk(pFontCChar);
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6926 pWindow_MainMenu->Release();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 pIcons_LOD->_4114F2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928 v16.Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6929 v21.Release();
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
6930 return MENU_MAIN; // return MENU_Main
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6932
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6933
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6936 //----- (0049B04D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 int stru154::_49B04D(ODMFace *a2, BSPVertexBuffer *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6939 stru154 *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 signed int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 signed int result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6942 signed int v6; // [sp-8h] [bp-18h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 Vec3_float_ v; // [sp+4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945 v.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946 v3 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6947 v.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948 v.z = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949 _49B13D(a2, a3, &v, (float *)&a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 if ( a2->pFacePlane.vNormal.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6953 if ( !a2->pFacePlane.vNormal.x && !a2->pFacePlane.vNormal.y )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6958 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6960 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6962 if ( v4 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6963 v6 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6964 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6965 v6 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6966 result = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6968 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6970 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6972 v3->vNormal.x = v.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6973 v3->vNormal.y = v.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6974 v3->vNormal.z = v.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6975 v3->field_10 = *(float *)&a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6976 v3->field_14 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6979
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6980 //----- (0049B0C9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6981 int stru154::_49B0C9(Vec3_float_ *pNormal, float a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6983 signed int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6984 signed int result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6985 double v5; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6986 double v6; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6987 double v7; // st5@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988 signed int v8; // [sp+0h] [bp-4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6989
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6990 v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 if ( pNormal->z == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6993 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6997 if ( pNormal->x == 0.0 && pNormal->y == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7000 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7003 v8 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7004 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7005 v8 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7006 result = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7008 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7012 v5 = pNormal->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7013 v6 = pNormal->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7014 v7 = pNormal->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7015 this->field_14 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7016 this->vNormal.x = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7017 this->field_10 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7018 this->vNormal.y = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7019 this->vNormal.z = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7020 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 //----- (0049B13D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7024 int stru154::_49B13D(ODMFace *pFace, BSPVertexBuffer *pVertices, Vec3_float_ *a3, float *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7026 ODMFace *v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7028 unsigned __int16 *v7; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 Vec3_int_ *v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 Vec3_int_ *v9; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 double v10; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7032 int v11; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 Vec3_int_ *v12; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7034 double v13; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 double v14; // st6@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 double v15; // st5@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7037 int v16; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 Vec3_int_ *v17; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 double v18; // st5@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7040 Vec3_float_ *v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 int result; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 float v21; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7043 double v22; // st7@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 double v23; // st6@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 Vec3_float_ v2; // [sp+4h] [bp-64h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 float v25; // [sp+18h] [bp-50h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 float v26; // [sp+1Ch] [bp-4Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7048 float v27; // [sp+20h] [bp-48h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 float v28; // [sp+24h] [bp-44h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 float v29; // [sp+2Ch] [bp-3Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 float v30; // [sp+30h] [bp-38h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 float v31; // [sp+34h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7053 float v32; // [sp+38h] [bp-30h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 float v33; // [sp+3Ch] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 Vec3_float_ v1; // [sp+40h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7056 float v35; // [sp+4Ch] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7057 float v36; // [sp+50h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 float v37; // [sp+54h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7059 Vec3_float_ v38; // [sp+58h] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060 int v39; // [sp+64h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7061
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 v1.x = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7064 v5 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7065 v6 = pFace->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7066 v1.y = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7067 v1.z = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7068 if ( v6 - 1 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7070 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7071 a3->x = (double)(v5->pFacePlane.vNormal.x & 0xFFFF) * 0.000015259022 + (double)(v5->pFacePlane.vNormal.x >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7072 a3->y = (double)(v5->pFacePlane.vNormal.y & 0xFFFF) * 0.000015259022 + (double)(v5->pFacePlane.vNormal.y >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7073 a3->z = (double)(v5->pFacePlane.vNormal.z & 0xFFFF) * 0.000015259022 + (double)(v5->pFacePlane.vNormal.z >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7074 result = (int)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7075 *a4 = (double)(v5->pFacePlane.dist & 0xFFFF) * 0.000015259022 + (double)(v5->pFacePlane.dist >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7077 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7079 v7 = &pFace->pVertexIDs[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7080 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7082 v8 = pVertices->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7083 v9 = &v8[*(v7 - 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 v35 = (double)v9->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7085 v36 = (double)v9->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7086 v10 = (double)v9->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 v11 = *v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7088 v37 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7089 v12 = &v8[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 v13 = (double)v12->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7091 v14 = (double)v12->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 v15 = (double)v12->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 v16 = v7[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7094 v25 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 v17 = &v8[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096 v18 = (double)v17->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7097 v29 = (double)v17->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7098 v30 = (double)v17->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7099 v31 = v13 - v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 v32 = v14 - v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 v33 = v25 - v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7102 v1.x = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 v26 = v18 - v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7104 v1.y = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 v27 = v29 - v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7106 v1.z = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 v28 = v30 - v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 v19 = Vec3_float_::Cross(&v1, &v2, v26, v27, v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7109 v38.x = v19->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 v38.y = v19->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 v38.z = v19->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7112 if ( v38.x != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 if ( v38.y != 0.0 || v38.z != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7115 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 if ( v39 >= pFace->uNumVertices - 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 v5 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 v38.Normalize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 v21 = v38.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7126 a3->x = v38.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7127 v22 = v37 * v38.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 v23 = v36 * v38.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 a3->y = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7130 a3->z = v38.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 result = (int)a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 *a4 = -(v22 + v23 + v35 * v38.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7134 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7137
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7141 //----- (0049D700) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7142 unsigned int __fastcall GetMaxMipLevels(unsigned int uDim)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 unsigned int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7145 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7146 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7148 v1 = uDim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7149 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7150 v3 = v1 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7151 while ( v3 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7153 v3 >>= 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7154 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7156 return v3 == 0 ? v2 : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7165
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7168 //----- (004A19D8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7169 int __fastcall sub_4A19D8(unsigned int a1, unsigned int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7171 signed __int64 v2; // ST10_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7172 double v3; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7173 float v4; // ST24_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7174 double v5; // ST10_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7175 int v6; // ST1C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7176 float v7; // ST24_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7177 double v8; // ST10_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7178 unsigned __int8 v9; // ST20_1@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7179 float v10; // ST24_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7180 double v11; // ST10_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7181 float v12; // ST24_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7182 double v13; // ST08_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7183
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7184 v2 = a1 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7185 v3 = (double)v2 * 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7186 LODWORD(v2) = a2 >> 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7187 v4 = v3 * (double)v2 * 0.0039215689 * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 v5 = v4 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7189 v6 = LODWORD(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7190 v7 = (double)((a1 >> 16) & 0xFFi64) * 0.0039215689 * (double)((a2 >> 16) & 0xFF) * 0.0039215689 * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 v8 = v7 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7192 v9 = LOBYTE(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7193 v10 = (double)((unsigned __int16)a1 >> 8) * 0.0039215689 * (double)((unsigned __int16)a2 >> 8) * 0.0039215689 * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 v11 = v10 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7195 v12 = (double)(a1 & 0xFFi64) * 0.0039215689 * (double)(unsigned __int8)a2 * 0.0039215689 * 255.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 v13 = v12 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 return LOBYTE(v13) | ((LOBYTE(v11) | (((v6 << 8) | v9) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7201 //----- (004A1C1E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7202 void __cdecl DoRenderBillboards_D3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 signed int v0; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 signed int *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7206 //IDirect3DDevice3Vtbl *v2; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 unsigned int v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7208 unsigned int v4; // [sp+58h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7210 v0 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 ErrD3D(pRenderer->pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, 3u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7213 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 if ( ((pRenderer->uNumBillboardsToDraw - 1) & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 v1 = (signed int *)&pRenderer->pBillboardRenderListD3D[pRenderer->uNumBillboardsToDraw - 1].bOpaque;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 v4 = pRenderer->uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7219 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 ErrD3D(pRenderer->pRenderD3D->pDevice->SetTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7223 (IDirect3DTexture2 *)*(v1 - 35)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 if ( *v1 != v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7226 v0 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 SetBillboardBlendOptions(*v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 ErrD3D(pRenderer->pRenderD3D->pDevice->DrawPrimitive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7230 D3DPT_TRIANGLEFAN,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7231 452,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 v1 - 33,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 *(v1 - 34),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7234 24));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 v1 -= 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7238 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 if ( pRenderer->turnFogOn )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 pRenderer->turnFogOn = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7244 //v2 = pRenderer->pRenderD3D->pDevice->lpVtbl;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 v3 = GetLevelFogColor();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7246 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGCOLOR, v3 & 0xFFFFFF));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7247 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGTABLEMODE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7249 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, 2u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7250 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7251 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7252 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7253 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7254 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7257 //----- (004A1DA8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7258 void __fastcall SetBillboardBlendOptions(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7260 //IDirect3DDevice3Vtbl *v1; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7261 unsigned int v2; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7262 int v3; // [sp+0h] [bp-4h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7264 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 if ( pRenderer->turnFogOn )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7268 pRenderer->turnFogOn = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7269 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 1u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 //v1 = pRenderer->pRenderD3D->pDevice->lpVtbl;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7271 v2 = GetLevelFogColor();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7272 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGCOLOR, v2 & 0xFFFFFF));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7273 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGTABLEMODE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7275 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 5));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7276 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 6u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7277 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7278 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7280 if ( a1 > 0 && a1 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7282 if ( pRenderer->bUsingSpecular )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7284 if ( !pRenderer->turnFogOn )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7286 pRenderer->turnFogOn = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7287 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7291 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 2u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7292 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7300
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7301
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7302 //----- (004A46E6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 int __fastcall sub_4A46E6(unsigned int x, signed int y, signed int a3, int a4, unsigned int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7305 int v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 int z; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7307 unsigned int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 unsigned int v8; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7309 int v9; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 unsigned int v10; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 int *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7312 int *v12; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 int v13; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 int v14; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7315 unsigned int v15; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 int *v16; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 int *v17; // edi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7318 int v18; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 int v19; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 unsigned __int16 *pTarget; // [sp+Ch] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 int *pTargetZ; // [sp+10h] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7322 unsigned int v22; // [sp+1Ch] [bp+8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 signed int v23; // [sp+20h] [bp+Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 v5 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 v23 = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 z = x + v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 if ( z >= (signed int)pViewport->uViewportX
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7329 && (signed int)x <= (signed int)pViewport->uViewportZ
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7330 && y >= (signed int)pViewport->uViewportY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 && y <= (signed int)pViewport->uViewportW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7333 if ( (signed int)x < (signed int)pViewport->uViewportX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 x = pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 if ( z > (signed int)pViewport->uViewportZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 z = pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7337 pTarget = &pRenderer->pTargetSurface[x + y * pRenderer->uTargetSurfacePitch];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 v22 = z - x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 pTargetZ = &pRenderer->pActiveZBuffer[x + 640 * y];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7340 v7 = a5 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 v8 = a5 & 0xF0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 v9 = v7 & 0x1E0000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7343 if ( pRenderer->uTargetGBits == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7345 v10 = (v8 | (((unsigned __int16)(a5 & 0xF000) | (unsigned int)v9) >> 3)) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7346 v11 = (int *)pTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 v12 = pTargetZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7348 v13 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7349 v14 = (v10 << 16) | v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7350 z = (unsigned __int8)pTarget & 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7351 if ( (unsigned __int8)pTarget & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7353 z = (unsigned int)*pTargetZ >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7354 if ( z > v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7356 z = v14 + ((*pTarget & 0x7BDEu) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7357 *pTarget = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7359 v13 = v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7360 v11 = (int *)(pTarget + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7361 v12 = pTargetZ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7363 while ( v13 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365 if ( v13 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7366 return z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367 z = (unsigned int)*v12 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7368 if ( z <= v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7370 v13 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7372 v12 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7374 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7376 v12 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7377 z = v14 + ((*v11 & 0x7BDE7BDEu) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378 v13 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7379 *v11 = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7380 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383 z = (unsigned int)*v12 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 if ( z > v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 z = v14 + ((*(short *)v11 & 0x7BDEu) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 *(short *)v11 = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 v15 = (v8 | (((unsigned __int16)(a5 & 0xF800) | (unsigned int)v9) >> 2)) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 v16 = (int *)pTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 v17 = pTargetZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395 v18 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 v19 = (v15 << 16) | v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 z = (unsigned __int8)pTarget & 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398 if ( (unsigned __int8)pTarget & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 z = (unsigned int)*pTargetZ >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 if ( z > v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 z = v19 + ((*pTarget & 0xF7DEu) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 *pTarget = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406 v18 = v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 v16 = (int *)(pTarget + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408 v17 = pTargetZ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410 while ( v18 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 if ( v18 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 return z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 z = (unsigned int)*v17 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 if ( z <= v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 v18 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 v17 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 v17 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 z = v19 + ((*v16 & 0xF7DEF7DEu) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 v18 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 *v16 = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7430 z = (unsigned int)*v17 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7431 if ( z > v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 z = v19 + ((*(short *)v16 & 0xF7DEu) >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 *(short *)v16 = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 return z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 //----- (004A57E9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 void __cdecl Present_ColorKey()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 HRESULT v0; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 HRESULT v1; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 HRESULT v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 HRESULT v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 HRESULT v4; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 RECT a2; // [sp+4h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 //CheckHRESULT_stru0 this; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 if ( !pRenderer->uNumSceneBegins )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 if ( pRenderer->field_40110 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457 a2.bottom = pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 a2.left = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 a2.top = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 a2.right = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 ErrD3D(pRenderer->pBackBuffer4->BltFast(0, 0, pRenderer->pColorKeySurface4, &a2, 16u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 a2.right = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 a2.left = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 a2.top = pViewport->uViewportW + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 a2.bottom = 480;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 ErrD3D(pRenderer->pBackBuffer4->BltFast(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 pViewport->uViewportW + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469 pRenderer->pColorKeySurface4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471 16u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472 a2.right = pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473 a2.bottom = pViewport->uViewportW + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474 a2.left = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475 a2.top = pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476 ErrD3D(pRenderer->pBackBuffer4->BltFast(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478 pViewport->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 pRenderer->pColorKeySurface4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 16u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 a2.left = pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 a2.top = pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 a2.right = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 a2.bottom = pViewport->uViewportW + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 ErrD3D(pRenderer->pBackBuffer4->BltFast(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487 pViewport->uViewportZ,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488 pViewport->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489 pRenderer->pColorKeySurface4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491 16u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492 a2.right = pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493 a2.bottom = pViewport->uViewportW + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494 a2.left = pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495 a2.top = pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496 ErrD3D(pRenderer->pBackBuffer4->BltFast(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7497 pViewport->uViewportX,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7498 pViewport->uViewportY,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7499 pRenderer->pColorKeySurface4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7500 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7501 17u));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 //----- (004A597D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7507 void __cdecl Present_NoColorKey()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7509 //unsigned __int16 *v0; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7510 unsigned __int16 *v1; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7511 void *v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 //signed int v4; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 //signed int v5; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 //void *v6; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 //const void *v7; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 signed int v8; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517 int v9; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 unsigned int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519 unsigned __int32 v11; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 //int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 unsigned int v13; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 int v14; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 int v15; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 int v16; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 int v17; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 HRESULT v18; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 DDSURFACEDESC2 Dst; // [sp+Ch] [bp-98h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 int v20; // [sp+88h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 int v21; // [sp+8Ch] [bp-18h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 __int32 v22; // [sp+90h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 //unsigned __int32 v23; // [sp+94h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 unsigned int v24; // [sp+98h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 //unsigned int _this; // [sp+9Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 //LPVOID v26; // [sp+A0h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 if ( !pRenderer->uNumSceneBegins )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 if ( pRenderer->field_40110 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 memset(&Dst, 0, 0x7Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 Dst.dwSize = 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, 1u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544 //v26 = Dst.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545 pRenderer->pCurrentlyLockedSurfaceDataPtr = (unsigned __int16 *)Dst.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7546 v24 = pRenderer->uTargetGMask | pRenderer->uTargetBMask |
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7547 ((pRenderer->uTargetGMask | pRenderer->uTargetBMask) << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 pRenderer->pCurrentlyLockedSoftSurface = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7549 pRenderer->uCurrentlyLockedSurfacePitch = Dst.lPitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7550 v1 = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7551 v2 = Dst.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7552
24
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7553 for (uint y = 0; y < 480; ++y)
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7554 {
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7555 auto pDst = (unsigned short *)((char *)Dst.lpSurface + y * Dst.lPitch);
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7556 for (uint x = 0; x < 640; ++x)
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7557 pDst[x] = pRenderer->uTargetGMask | pRenderer->uTargetBMask;
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7558 }
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7559
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 auto pSrc = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561 auto pDst = (__int16 *)Dst.lpSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7563 for (uint y = 0; y < 8; ++y)
24
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7564 memcpy(pDst + y * Dst.lPitch / 2,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 pSrc + y * 640, 640 * sizeof(__int16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7566
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7567 for (uint y = 8; y < 352; ++y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568 {
24
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7569 memcpy(pDst + y * Dst.lPitch / 2,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7570 pSrc + y * 640, 8 * sizeof(__int16));
24
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7571 memcpy(pDst + 8 + 460/*462*/ + y * Dst.lPitch / 2,
25
2bbf33898c6b c/p error in prev commit
Nomad
parents: 24
diff changeset
7572 pSrc + 8 + 460/*462*/ + y * 640, 174/*172*/ * sizeof(__int16));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7574
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7575 for (uint y = 351/*352*/; y < 480; ++y)
24
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7576 memcpy(pDst + y * Dst.lPitch / 2,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7577 pSrc + y * 640, 640 * sizeof(__int16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7579
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7580 auto pSrc_x1y1 = pSrc + 640 * pViewport->uViewportY + pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7581 //_this = (unsigned int)&pSrc[2 * (((signed int)pViewport->uViewportX >> 1) + 320 * pViewport->uViewportY)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7582 auto pDst_x1y1 = pDst + Dst.lPitch * pViewport->uViewportY + pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7583 //v23 = (unsigned __int32)((char *)v26 + 4 * (((signed int)pViewport->uViewportX >> 1) + (Dst.lPitch >> 2) * pViewport->uViewportY));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7584 v9 = ((signed int)pViewport->uViewportX >> 1) - ((signed int)pViewport->uViewportZ >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7585 //v20 = ((signed int)pViewport->uViewportZ >> 1) - ((signed int)pViewport->uViewportX >> 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7586 v22 = 4 * ((Dst.lPitch / 4) + v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7587 v21 = 4 * v9 + 1280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 auto uNumLines = pViewport->uViewportW - pViewport->uViewportY + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7590 //v26 = (LPVOID)(pViewport->uViewportW - pViewport->uViewportY + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 v10 = (int)pSrc_x1y1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7592 v11 = (int)pDst_x1y1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7593 auto uHalfWidth = v20 = (pViewport->uViewportZ - pViewport->uViewportX) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7594 v13 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7595
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7596 for (uint y = pViewport->uViewportY; y < pViewport->uViewportW; ++y)
24
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7597 memcpy(pDst + pViewport->uViewportX + y * Dst.lPitch / 2,
74940016abc8 * on Players
Nomad
parents: 23
diff changeset
7598 pSrc + pViewport->uViewportX + y * 640, (pViewport->uViewportZ - pViewport->uViewportX) * sizeof(__int16));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7600 ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7602 /* while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7604 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7606 v14 = *(int *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7607 v10 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7608 if ( v14 == v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7609 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7610 if ( (short)v14 == (short)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 *(int *)v11 = *(int *)v11 & 0xFFFF | v14 & 0xFFFF0000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 v11 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7614 --uHalfWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7615 if ( !uHalfWidth )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7620 v15 = __ROL__(v14, 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621 if ( (short)v15 == (short)v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623 v17 = __ROR__(v15, 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7624 *(int *)v11 = *(int *)v11 & 0xFFFF0000 | (unsigned __int16)v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7625 v11 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7626 --uHalfWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7627 if ( !uHalfWidth )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7628 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7630 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7632 v16 = __ROR__(v15, 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7633 *(int *)v11 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7634 v11 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7635 --uHalfWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 if ( !uHalfWidth )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7641 v11 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642 --uHalfWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 if ( !uHalfWidth )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7645 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 v10 += v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7647 v11 += v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7648 uHalfWidth = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 if ( !--uNumLines )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7651 ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7652 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7655 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7662
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 //----- (004A7063) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7664 int __thiscall sub_4A7063(unsigned int uDiffuse, float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7666 float v2; // ST1C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 double v3; // ST14_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 signed int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 float v5; // ST1C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7670 double v6; // ST14_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 signed int v7; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 double v8; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 signed int v9; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 signed int v10; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7675 double v12; // [sp+8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7676 unsigned __int64 v13; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7677
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7678 v2 = (double)(uDiffuse >> 24) * a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 v3 = v2 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7680 v4 = LODWORD(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7681 v5 = (double)((uDiffuse >> 16) & 0xFF) * a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7682 v6 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7683 v7 = LODWORD(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 *((float *)&v6 + 1) = (double)((unsigned __int16)uDiffuse >> 8) * a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 v8 = *((float *)&v6 + 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 v13 = __PAIR__(LODWORD(v6), LODWORD(v8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 v9 = LODWORD(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7688 *((float *)&v6 + 1) = (double)(unsigned __int8)uDiffuse * a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 v12 = *((float *)&v6 + 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 v10 = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7691 if ( v4 > 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7692 v4 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7693 if ( v4 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7694 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7695 if ( SHIDWORD(v13) > 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 v7 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 if ( v7 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 if ( (signed int)v13 > 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 v9 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 if ( v9 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 if ( SLODWORD(v12) > 255 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 v10 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 if ( v10 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 return v10 | ((v9 | ((v7 | (v4 << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7714 //----- (004AC1C9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 int __thiscall sub_4AC1C9(unsigned int _this, Vec4_int_ *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 __int16 v3; // di@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 signed int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 int v5; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7721 Vec4_int_ *v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 Vec4_int_ *v7; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 int result; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 char *v9; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 Vec4_int_ a1; // [sp+Ch] [bp-34h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 Vec4_int_ v11; // [sp+1Ch] [bp-24h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 Vec4_int_ Dst; // [sp+2Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7728 int v13; // [sp+3Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 v3 = sub_4382BC(_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7732 v13 = sub_4383ED();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7733 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7734 memset(&Dst, 0, 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 if ( v3 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7736 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 if ( (signed int)v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7739 if ( (signed int)v2 > 150 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 v5 = (int)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7743 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7745 v5 = 4000 * v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7749 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7751 v5 = 4000 * dword_4F031C[(unsigned __int16)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7753 if ( v13 & 0x10 && !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7755 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756 v6 = sub_4AC4FD_get_cpu_clocks_rdtsc(v5, &a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758 v6 = sub_4AC33A_get_cpu_clocks_QPC(v5, &a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 if ( (unsigned __int16)v3 < 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 v7 = &Dst;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 v6 = sub_4AC277(v5, &a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 v11.x = v6->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770 v11.y = v6->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7771 v11.z = v6->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772 v11.w = v6->w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7773 v7 = &v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 result = (int)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 a2->x = v7->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 v9 = (char *)&v7->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 a2->y = *(int *)v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7779 v9 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 a2->z = *(int *)v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 a2->w = *((int *)v9 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7784 // 4F031C: using guessed type int dword_4F031C[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7785
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786 //----- (004AC277) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787 Vec4_int_ *__thiscall sub_4AC277(unsigned int _this, Vec4_int_ *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7791 /*signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 signed __int16 v4; // bx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 int v10; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794 int v11; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795 Vec4_int_ *result; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796 Vec4_int_ Dst; // [sp+8h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797 LARGE_INTEGER Frequency; // [sp+18h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798 LARGE_INTEGER PerformanceCount; // [sp+20h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 LARGE_INTEGER v16; // [sp+28h] [bp-10h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 int v17; // [sp+30h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 int v18; // [sp+34h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 v17 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 v2 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 memset(&Dst, 0, 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 if ( QueryPerformanceFrequency(&Frequency) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7808 v18 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7809 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7811 QueryPerformanceCounter(&PerformanceCount);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 _EAX = -2147483648;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813 v4 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7816 __asm { bsf ecx, eax }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 --v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 while ( v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 QueryPerformanceCounter(&v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 if ( (signed int)v16.s.LowPart - (signed int)PerformanceCount.s.LowPart < (unsigned int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822 v2 = v16.s.LowPart - PerformanceCount.s.LowPart;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 --v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 while ( v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 v10 = 100000 * v2 / (Frequency.s.LowPart / 0xA);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 if ( v10 % Frequency.s.LowPart > Frequency.s.LowPart >> 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 v11 = v17 / (unsigned int)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 Dst.z = v17 / (unsigned int)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 if ( v17 % (unsigned int)v10 > (unsigned int)v10 >> 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 Dst.x = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 Dst.y = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7835 Dst.w = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 a2->x = Dst.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 a2->y = Dst.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 a2->z = Dst.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841 a2->w = Dst.w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 //----- (004AC33A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 Vec4_int_ *__thiscall sub_4AC33A_get_cpu_clocks_QPC(int _this, Vec4_int_ *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 /*int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 unsigned __int64 v4; // qax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 unsigned __int64 v5; // qax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 DWORD v6; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7855 DWORD v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 unsigned int v8; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7857 unsigned __int64 v9; // qax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 unsigned int v10; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 int v11; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 unsigned int v12; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 Vec4_int_ *result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 int Dst; // [sp+Ch] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 int v15; // [sp+10h] [bp-48h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 int v16; // [sp+14h] [bp-44h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 int v17; // [sp+18h] [bp-40h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 LARGE_INTEGER Frequency; // [sp+1Ch] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867 LARGE_INTEGER PerformanceCount; // [sp+24h] [bp-34h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 LARGE_INTEGER v20; // [sp+2Ch] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 int v21; // [sp+34h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 int v22; // [sp+38h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 int v23; // [sp+3Ch] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 int v24; // [sp+40h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873 int nPriority; // [sp+44h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7874 unsigned int v26; // [sp+48h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 unsigned int v27; // [sp+4Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7876 HANDLE hThread; // [sp+50h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7877 int v29; // [sp+54h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7878
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7879 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884 hThread = GetCurrentThread();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 memset(&Dst, 0, 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7886 if ( QueryPerformanceFrequency(&Frequency) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 v22 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7892 v21 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 QueryPerformanceCounter(&PerformanceCount);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 v20 = PerformanceCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7895 nPriority = GetThreadPriority(hThread);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7896 if ( nPriority != 2147483647 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7897 SetThreadPriority(hThread, 15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7898 while ( v20.s.LowPart - PerformanceCount.s.LowPart < 0x32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7900 QueryPerformanceCounter(&v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7901 v4 = __rdtsc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 v23 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 PerformanceCount = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907 QueryPerformanceCounter(&v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908 v5 = __rdtsc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909 v24 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 v6 = v20.s.LowPart;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7911 v7 = PerformanceCount.s.LowPart;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 while ( v20.s.LowPart - PerformanceCount.s.LowPart < 0x3E8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 if ( nPriority != 2147483647 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 SetThreadPriority(hThread, nPriority);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 v7 = PerformanceCount.s.LowPart;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 v6 = v20.s.LowPart;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7920 v8 = v24 - v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 v27 += v24 - v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7922 v9 = (100000 * v6 - 100000 * v7) / (Frequency.s.LowPart / 0xA);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 v26 += v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 if ( v9 % Frequency.s.LowPart > Frequency.s.LowPart >> 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 v10 = v9 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 v3 = v8 / v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 if ( v8 % v10 > v10 >> 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 v3 = v8 / v10 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 v2 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 v11 = v3 + v22 + v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933 while ( v29 < 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 || v29 < 20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935 && ((unsigned int)(3 * v3 - v11) > 3 || (unsigned int)(3 * v21 - v11) > 3 || (unsigned int)(3 * v22 - v11) > 3) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 v12 = 10 * v27 / v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 if ( 100 * v27 / v26 - 10 * v12 >= 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939 v16 = v27 / v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 v17 = v27 / v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 if ( v12 - 10 * v27 / v26 >= 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 v17 = v27 / v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 v15 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 Dst = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 a1->x = Dst;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 a1->y = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949 a1->z = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 a1->w = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 //----- (004AC4FD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 Vec4_int_ *__thiscall sub_4AC4FD_get_cpu_clocks_rdtsc(int _this, Vec4_int_ *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959 /*int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 int v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 bool v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962 unsigned __int64 v5; // kr00_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 int v6; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 bool v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 unsigned __int64 v9; // kr08_8@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 unsigned int v10; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968 Vec4_int_ *result; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7969 int Dst; // [sp+Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7970 int v13; // [sp+10h] [bp-28h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 int v14; // [sp+14h] [bp-24h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 int v15; // [sp+18h] [bp-20h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 unsigned int v16; // [sp+1Ch] [bp-1Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974 unsigned int v17; // [sp+20h] [bp-18h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7975 unsigned int v18; // [sp+24h] [bp-14h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7976 int nPriority; // [sp+28h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7977 __int64 v20; // [sp+2Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7978 int v21; // [sp+34h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980 HIDWORD(v20) = GetCurrentThread();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 memset(&Dst, 0, 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7982 v2 = GetThreadPriority(HIDWORD(v20));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7983 nPriority = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7984 if ( v2 != 0x7FFFFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7985 SetThreadPriority(HIDWORD(v20), v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 __outbyte(0x70u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 v21 = __inbyte(0x71u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 __outbyte(0x70u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991 LODWORD(v20) = __inbyte(0x71u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 v3 = v20 - v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993 if ( (signed int)v20 >= v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 v4 = v3 > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 v4 = v3 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 while ( !v4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 v5 = __rdtsc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 v16 = HIDWORD(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 v17 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 __outbyte(0x70u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 v21 = __inbyte(0x71u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 v6 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 v7 = v21 - v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 if ( v21 >= (signed int)v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 v8 = v7 > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 v8 = v7 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 while ( !v8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 v9 = __rdtsc();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 v18 = HIDWORD(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 v21 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 if ( nPriority != 0x7FFFFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 SetThreadPriority(HIDWORD(v20), nPriority);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8019 nPriority = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8020 *(__int64 *)((char *)&v20 + 4) = __PAIR__(v18, v21) - __PAIR__(v16, v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8021 Dst = HIDWORD(v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8022 v10 = HIDWORD(v20) / 0xF4240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 v14 = HIDWORD(v20) / 0xF4240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 if ( HIDWORD(v20) / 0x186A0 - 10 * HIDWORD(v20) / 0xF4240 >= 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 v15 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 v13 = 1000000 * v6 - 1000000 * v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 a1->x = Dst;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 a1->y = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 a1->z = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8032 a1->w = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8035
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8037
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8038 //----- (004AD504) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 int __fastcall sub_4AD504(unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8041 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8042 unsigned int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8043 BLVFace *v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 Texture *v4; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 int v6; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 int v7; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 int v8; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 int v9; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 int v10; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 unsigned int v11; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052 int v12; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8053 int v13; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 unsigned __int16 *v14; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 unsigned int v15; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 unsigned __int16 *v16; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 int v17; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 int v18; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 int v19; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 int v20; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 int v21; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 stru193_math *v22; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 int v23; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 char *v24; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 int v25; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 int v26; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 int v27; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 signed int v28; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 signed int v29; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 signed int v30; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 signed int v31; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 int v32; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 int v33; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 int *v34; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075 unsigned __int16 *v35; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 unsigned int v36; // edx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 int v37; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 char v38; // cl@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 char v39; // ch@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 int v40; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 int v41; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 unsigned int v42; // ebx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 int v43; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 int v44; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 int *v45; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 unsigned __int16 *v46; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 unsigned int v47; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 int v48; // ebx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 char v49; // cl@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 char v50; // ch@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091 int v51; // ebx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 int v52; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 unsigned __int16 v53; // bx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 int v54; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 int v55; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 int v56; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 int *v57; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 unsigned __int16 *v58; // edi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099 unsigned int v59; // edx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 int v60; // ebx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 char v61; // cl@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 char v62; // ch@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103 unsigned int v63; // ebx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 int v64; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 unsigned int v65; // ebx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 int v66; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 unsigned int v67; // ebx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 int v68; // edx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 int v69; // ebx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 int v70; // edx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 int v71; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 int *v72; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 unsigned __int16 *v73; // edi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 unsigned int v74; // edx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 int v75; // ebx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 char v76; // cl@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 char v77; // ch@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 unsigned int v78; // ebx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119 int v79; // edx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120 unsigned int v80; // ebx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 int v81; // edx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 unsigned int v82; // ebx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 int v83; // edx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 int v84; // ebx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 int v85; // edx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 unsigned __int8 *v86; // [sp+Ch] [bp-98h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127 unsigned __int8 *v87; // [sp+10h] [bp-94h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 unsigned __int8 *v88; // [sp+14h] [bp-90h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 unsigned __int8 *v89; // [sp+18h] [bp-8Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 int v90; // [sp+1Ch] [bp-88h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 BLVFace *v91; // [sp+20h] [bp-84h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 int v92; // [sp+24h] [bp-80h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 int i; // [sp+28h] [bp-7Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 unsigned __int16 *v94; // [sp+2Ch] [bp-78h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 unsigned int v95; // [sp+30h] [bp-74h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 Texture *v96; // [sp+34h] [bp-70h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 int v97; // [sp+38h] [bp-6Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 unsigned int v98; // [sp+3Ch] [bp-68h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 int v99; // [sp+40h] [bp-64h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 int v100; // [sp+44h] [bp-60h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 int v101; // [sp+48h] [bp-5Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 int v102; // [sp+4Ch] [bp-58h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 int v103; // [sp+50h] [bp-54h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 int v104; // [sp+54h] [bp-50h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 unsigned __int8 *v105; // [sp+58h] [bp-4Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 int v106; // [sp+5Ch] [bp-48h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 int v107; // [sp+60h] [bp-44h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148 int v108; // [sp+64h] [bp-40h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 int v109; // [sp+68h] [bp-3Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 int v110; // [sp+6Ch] [bp-38h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 int v111; // [sp+70h] [bp-34h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 int a1; // [sp+74h] [bp-30h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 int a2; // [sp+78h] [bp-2Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 int *v114; // [sp+7Ch] [bp-28h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 int v115; // [sp+80h] [bp-24h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 int v116; // [sp+84h] [bp-20h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 unsigned int v117; // [sp+88h] [bp-1Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 unsigned int v118; // [sp+8Ch] [bp-18h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 int *v119; // [sp+90h] [bp-14h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 int v120; // [sp+94h] [bp-10h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 unsigned int v121; // [sp+98h] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 unsigned __int16 *v122; // [sp+9Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 unsigned int v123; // [sp+A0h] [bp-4h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 result = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 v2 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 v95 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 if ( (uFaceID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 if ( (signed int)uFaceID < (signed int)pIndoor->uNumFaces )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 v3 = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 v91 = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 result = sub_423B5D(uFaceID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 result = sub_424829(result, &stru_F8A590, pBLVRenderParams->field_7C, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 result = (int)v3->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 v4 = (Texture *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 v96 = (Texture *)result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 v5 = *(short *)(result + 38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 LOBYTE(v3->uAttributes) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 v92 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 sub_4AE5F1(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8191 ++pBLVRenderParams->field_84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 v6 = stru_F8AD28.pDeltaUV[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 v116 = stru_F8AD28.pDeltaUV[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 for ( i = bUseLoResSprites; v7 < stru_F8AD28.field_AC; *(int *)v9 = v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 v8 = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 stru_F8AD28._blv_lights_xs[v7] += v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 v9 = 4 * v7 + 16297672;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 v10 = v8 - stru_F8AD28._blv_lights_ys[v7++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 v94 = sr_sub_47C24C_get_palette(v3, v92, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 result = stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 a2 = stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 v11 = stru_F8A590._viewport_space_y * pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 v99 = 640 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 v86 = v4->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 v87 = v4->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 v88 = v4->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 v89 = v4->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 v98 = stru_F8A590._viewport_space_y * pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8212 v104 = 2 * pBLVRenderParams->field_0_timer_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 if ( stru_F8A590._viewport_space_y <= stru_F8A590.field_4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 v12 = 2 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 v101 = 2 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 a1 = *(__int16 *)((char *)stru_F8A590.array_18 + v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 sub_4AE313(a1, result, &stru_F81018.field_0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 if ( LOBYTE(viewparams->field_20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 v15 = v95 * (v12 - pBLVRenderParams->uViewportY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 v119 = &pBLVRenderParams->pTargetZBuffer[2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 * (*(__int16 *)((char *)stru_F8A590.array_18 + v12)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 + 320 * (v12 - pBLVRenderParams->uViewportY))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 - pBLVRenderParams->uViewportX];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 v16 = &pBLVRenderParams->pRenderTarget[v15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 + 2 * *(__int16 *)((char *)stru_F8A590.array_18 + v12)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 - pBLVRenderParams->uViewportX];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 v14 = &pBLVRenderParams->pRenderTarget[v15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 + 2 * *(__int16 *)((char *)stru_F8A590.array_3D8 + v12)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 - pBLVRenderParams->uViewportX];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 v123 = (unsigned int)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 v13 = *(__int16 *)((char *)stru_F8A590.array_18 + v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 v119 = &pBLVRenderParams->pTargetZBuffer[v13 + v99];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 v123 = (unsigned int)&pBLVRenderParams->pRenderTarget[v13 + v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 v14 = &pBLVRenderParams->pRenderTarget[v11 + *(__int16 *)((char *)stru_F8A590.array_3D8 + v12)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 v117 = (unsigned int)v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 HIWORD(v17) = HIWORD(stru_F81018.field_0.field_0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 v18 = stru_F81018.field_0.field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 LOWORD(v17) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 v97 = stru_F8AD28.field_0 | v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248 v110 = sub_4AE491(SHIWORD(stru_F81018.field_0.field_4), SHIWORD(stru_F81018.field_0.field_8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 v19 = stru_F81018.field_0.field_4 >> i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 v20 = 11 - v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 v116 = stru_F81018.field_0.field_8 >> i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252 v21 = stru_F81018.field_0.field_8 >> i >> (11 - v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 v22 = stru_5C6E00;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 v122 = (unsigned __int16 *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 v121 = (stru_F81018.field_0.field_4 >> i) + 4 * stru_5C6E00->SinCos(v104 + v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 v23 = stru_5C6E00->SinCos(v104 + (v19 >> (char)v122) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 v120 = v116 + 4 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 if ( v123 < v117 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 v24 = (char *)&stru_F81018.field_34.field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 v114 = &stru_F81018.field_34.field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262 a1 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 sub_4AE313(a1, a2, (stru337_stru0 *)(v24 - 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 v25 = *((int *)v24 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 LOWORD(v25) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 v115 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 v26 = stru_F8AD28.field_0 | v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 if ( v97 <= (unsigned int)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 v115 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272 v97 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 v27 = *((int *)v24 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 v28 = *((int *)v24 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8275 v105 = (&v86)[4 * v27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 v111 = v27 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 v29 = v4->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 v109 = v27 + v27 + 16 - v4->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 v107 = v29 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 v30 = v28 >> i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8281 v102 = v4->uHeightMinus1 >> v27 << (v27 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8282 v31 = *v114 >> i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8283 v122 = (unsigned __int16 *)(11 - v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 v116 = v30 + 4 * stru_5C6E00->SinCos(v104 + (v31 >> (11 - v27)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 v90 = v31 + 4 * stru_5C6E00->SinCos(v104 + (v30 >> (char)v122) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 v108 = (signed int)(v116 - v121) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8287 v103 = (v90 - v120) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8288 v32 = v123 + 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8289 if ( LOBYTE(viewparams->field_20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 v32 = v123 + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 if ( v32 > v117 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 v32 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 v118 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 v100 = sub_4AE491(*((short *)v114 - 1), *((short *)v114 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 v106 = (signed int)(v32 - v123) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296 if ( v110 >> 16 == v100 >> 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 v122 = sr_sub_47C24C_get_palette(v91, v92, v110 >> 16, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8299 if ( LOBYTE(viewparams->field_20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 v44 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 if ( v123 < v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 v45 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 v46 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 v47 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307 v48 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8308 v49 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8309 v50 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8310 if ( v106 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 *v119 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 v45 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 v44 = v123 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319 v44 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8320 v51 = *(&v105[v107 & (v47 >> v49)] + ((v102 & (unsigned int)v48) >> v50));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 v52 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 LOWORD(v51) = v46[v51];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 *v45 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 v45[1] = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325 v45[640] = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 v45[641] = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 *(short *)(v44 - 8) = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328 *(short *)(v44 - 6) = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 *(short *)(v44 + 1272) = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330 *(short *)(v44 + 1274) = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331 v45[2] = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332 v45[3] = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333 v45[642] = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334 v45[643] = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335 v121 += v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336 v120 += v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 v47 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 v48 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 v45 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341 v53 = v46[*(&v105[v107 & (v47 >> v49)] + ((v102 & (unsigned int)v48) >> v50))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342 v54 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343 *(short *)(v44 - 4) = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344 *(short *)(v44 - 2) = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 *(short *)(v44 + 1276) = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346 *(short *)(v44 + 1278) = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 v121 += v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348 v120 += v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 v47 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350 v48 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 while ( v44 < v118 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 v123 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 v119 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 v33 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 if ( v123 < v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362 v34 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363 v35 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364 v36 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365 v37 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366 v38 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 v39 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 if ( v106 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 *v119 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8371 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 v33 = v123 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 v33 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 v40 = *(&v105[v107 & (v36 >> v38)] + ((v102 & (unsigned int)v37) >> v39));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 v41 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 LOWORD(v40) = v35[v40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 *v34 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 *(short *)(v33 - 4) = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 v34[1] = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 v121 += v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 v120 += v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 v36 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 v37 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 v42 = (unsigned int)(&v105[v107 & (v36 >> v38)] + ((v102 & (unsigned int)v37) >> v39));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 v34 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 v43 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8392 *(short *)(v33 - 2) = v35[*(char *)v42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 v121 += v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 v120 += v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395 v36 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396 v37 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8398 while ( v33 < v118 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 v123 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 v119 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8404 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 v55 = v110 - ((v100 - v110) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 v110 = (v100 - v110) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 v122 = (unsigned __int16 *)v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 if ( LOBYTE(viewparams->field_20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8411 v71 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8412 if ( v123 < v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 v72 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 v73 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416 v74 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8417 v75 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8418 v76 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8419 v77 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 if ( v106 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8422 *v119 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423 v72 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424 v71 = v123 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 goto LABEL_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 v78 = (v107 & (v74 >> v76)) + ((v102 & (unsigned int)v75) >> v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430 v79 = (int)((char *)v122 + v110);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 v71 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8432 v122 = (unsigned __int16 *)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8433 v80 = ((v79 & 0xFFFF0000u) >> 8) + v105[v78];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 v81 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 LOWORD(v80) = v73[v80];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 *v72 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437 v72[1] = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8438 v72[640] = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8439 v72[641] = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8440 *(short *)(v71 - 8) = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8441 *(short *)(v71 - 6) = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 *(short *)(v71 + 1272) = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 *(short *)(v71 + 1274) = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 v72[2] = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8445 v72[3] = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446 v72[642] = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447 v72[643] = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448 v121 += v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449 v120 += v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 v74 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 v75 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 v72 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8453 LABEL_52:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 v82 = (v107 & (v74 >> v76)) + ((v102 & (unsigned int)v75) >> v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 v83 = (int)((char *)v122 + v110);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456 v84 = v105[v82];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457 v122 = (unsigned __int16 *)v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458 LOWORD(v84) = v73[((v83 & 0xFFFF0000u) >> 8) + v84];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 v85 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 *(short *)(v71 - 4) = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8461 *(short *)(v71 - 2) = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8462 *(short *)(v71 + 1276) = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463 *(short *)(v71 + 1278) = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464 v121 += v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 v120 += v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8466 v74 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8467 v75 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 while ( v71 < v118 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8470 v123 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 v119 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8474 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 v56 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8477 if ( v123 < v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479 v57 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480 v58 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481 v59 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 v60 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483 v61 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 v62 = v109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 if ( v106 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 *v119 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8488 ++v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8489 v56 = v123 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8494 v63 = (v107 & (v59 >> v61)) + ((v102 & (unsigned int)v60) >> v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 v64 = (int)((char *)v122 + v110);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 v56 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497 v122 = (unsigned __int16 *)v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8498 v65 = ((v64 & 0xFFFF0000u) >> 8) + v105[v63];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499 v66 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500 LOWORD(v65) = v58[v65];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 *v57 = v115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 *(short *)(v56 - 4) = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 v57[1] = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8504 v121 += v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 v120 += v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 v59 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 v60 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508 v57 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8510 v67 = (v107 & (v59 >> v61)) + ((v102 & (unsigned int)v60) >> v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 v68 = (int)((char *)v122 + v110);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 v69 = v105[v67];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 v122 = (unsigned __int16 *)v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 LOWORD(v69) = v58[((v68 & 0xFFFF0000u) >> 8) + v69];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 v70 = v108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516 *(short *)(v56 - 2) = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 v121 += v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518 v120 += v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519 v59 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520 v60 = v120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 while ( v56 < v118 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 v123 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 v119 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 v114 += 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 v110 = v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 a1 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 v4 = v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 v121 = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 v120 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 if ( v123 >= v117 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 v24 = (char *)v114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537 v22 = stru_5C6E00;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 ++a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 v98 += v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 v101 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8544 v99 += 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 if ( a2 > stru_F8A590.field_4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 v12 = v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 result = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8549 v11 = v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560 // 4AE491: using guessed type int __fastcall sub_4AE491(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562 //----- (004ADD1D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563 void __fastcall sub_4ADD1D(int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566 BLVFace *v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567 signed int v3; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568 Texture *v4; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569 signed int v5; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8570 char *v6; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571 signed int v7; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8572 unsigned int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573 __int16 v9; // cx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 unsigned __int8 *v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 unsigned __int16 *v11; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8576 int v12; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 int v13; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 stru352 *v14; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 DWORD v15; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 signed int v16; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581 signed int v17; // ST68_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582 int v18; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583 int v19; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584 unsigned int v20; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585 int v21; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586 int v22; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587 int *v23; // ebx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588 int v24; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589 int v25; // ebx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590 unsigned __int16 v26; // cx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8591 int v27; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 unsigned __int16 v28; // cx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8593 unsigned __int8 v29; // sf@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 unsigned __int8 v30; // of@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 unsigned int v31; // esi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596 int v32; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 unsigned __int16 *v33; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 int *v34; // ebx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599 int v35; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 int v36; // ebx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 unsigned __int16 v37; // cx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 int v38; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 unsigned __int16 v39; // cx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604 Texture *v40; // [sp-10h] [bp-6Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 int v41; // [sp-Ch] [bp-68h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 unsigned int v42; // [sp+10h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 signed int v43; // [sp+14h] [bp-48h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 signed int v44; // [sp+14h] [bp-48h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 int v45; // [sp+1Ch] [bp-40h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 int v46; // [sp+20h] [bp-3Ch]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 int v47; // [sp+24h] [bp-38h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612 char v48; // [sp+28h] [bp-34h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 int v49; // [sp+2Ch] [bp-30h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614 unsigned __int8 *v50; // [sp+30h] [bp-2Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 unsigned __int16 *v51; // [sp+34h] [bp-28h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616 int v52; // [sp+38h] [bp-24h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 int v53; // [sp+3Ch] [bp-20h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 signed int v54; // [sp+40h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 int v55; // [sp+40h] [bp-1Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620 int v56; // [sp+44h] [bp-18h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 stru352 *i; // [sp+48h] [bp-14h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 unsigned __int16 *v58; // [sp+4Ch] [bp-10h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 int v59; // [sp+50h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 int v60; // [sp+50h] [bp-Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 int v61; // [sp+54h] [bp-8h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 int *v62; // [sp+58h] [bp-4h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 int *v63; // [sp+58h] [bp-4h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 v1 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 v42 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 if ( uFaceID >= 0 && uFaceID < (signed int)pIndoor->uNumFaces )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 v2 = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 v3 = sub_424579(uFaceID, &stru_F8AD28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 v59 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641 v59 = sub_423B5D(uFaceID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 v3 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8644 if ( v3 && (pRenderer->pRenderD3D || sub_424829(v3, &stru_F8A590, pBLVRenderParams->field_7C, v1)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8646 v4 = v2->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8647 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8648 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8650 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8652 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8654 v54 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8655 v43 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8656 v6 = (char *)&array_507D30[0].v;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8657 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8659 *((float *)v6 - 1) = (double)((GetTickCount() >> 5) - pBLVRenderParams->vPartyPos.x) + *((float *)v6 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8660 *(float *)v6 = (double)(pBLVRenderParams->vPartyPos.y + (GetTickCount() >> 5)) + *(float *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8661 v6 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8662 --v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 while ( v54 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665 v3 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 v5 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 v7 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669 v41 = stru_F8AD28.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 array_507D30[v7].u = array_507D30[v7].u * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 array_507D30[v7].v = array_507D30[v7].v * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 if ( BYTE1(v2->uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 v40 = v2->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 v8 = pTextureFrameTable->GetFrameTexture(v2->uBitmapID, pBLVRenderParams->field_0_timer_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 v40 = v2->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 v8 = v2->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8682 pRenderer->DrawIndoorPolygon(v3, v2, pBitmaps_LOD->pHardwareTextures[v8], v40, v41, -1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8684 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8686 v49 = v4->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 v47 = v4->uHeightMinus1 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 v9 = 16 - v4->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 v10 = v4->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690 LOBYTE(v2->uAttributes) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691 v48 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 v50 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 sub_4AF412();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 ++pBLVRenderParams->field_80;
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8695 v11 = sr_sub_47C24C_get_palette(v2, v4->palette_id2, 0, 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696 v12 = stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 v51 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 v60 = stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 if ( stru_F8A590._viewport_space_y <= stru_F8A590.field_4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 v13 = 2 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 v14 = &stru_F83B80[stru_F8A590._viewport_space_y];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703 v55 = 2 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704 v56 = 640 * stru_F8A590._viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705 for ( i = &stru_F83B80[stru_F8A590._viewport_space_y]; ; v14 = i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707 sub_4AE1E7(v12, *(__int16 *)((char *)stru_F8A590.array_18 + v13), v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 v14->field_0 += (GetTickCount() << 11) - (pBLVRenderParams->vPartyPos.x << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 v15 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 v16 = v14->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 v14->field_4 += (32 * pBLVRenderParams->vPartyPos.y + v15) << 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712 v45 = v14->field_4 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 v44 = v16 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714 v17 = (signed int)((unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)v14->field_28) >> 16) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715 v52 = (unsigned __int64)(v17 * (signed __int64)-pBLVRenderParams->sSineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 v53 = (unsigned __int64)(v17 * (signed __int64)pBLVRenderParams->sCosineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 v18 = v14->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 v19 = *(__int16 *)((char *)stru_F8A590.array_18 + v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719 LOWORD(v18) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720 v46 = stru_F8AD28.field_0 | v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721 v61 = *(__int16 *)((char *)stru_F8A590.array_3D8 + v13) - v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 if ( LOBYTE(viewparams->field_20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724 v63 = &pBLVRenderParams->pTargetZBuffer[2 * (v19 + 320 * (v13 - pBLVRenderParams->uViewportY))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8725 - pBLVRenderParams->uViewportX];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 v31 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727 v32 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728 v33 = &pBLVRenderParams->pRenderTarget[v42 * (v13 - pBLVRenderParams->uViewportY)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8729 + 2 * v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 - pBLVRenderParams->uViewportX];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8731 if ( v61 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8733 --v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8734 v33 = &pBLVRenderParams->pRenderTarget[v42 * (v13 - pBLVRenderParams->uViewportY)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 + 2 * v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736 - pBLVRenderParams->uViewportX
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8737 - 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738 v34 = &pBLVRenderParams->pTargetZBuffer[2 * (v19 + 320 * (v13 - pBLVRenderParams->uViewportY))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8739 - pBLVRenderParams->uViewportX];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8740 v35 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8741 v63 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8742 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8746 v30 = __OFSUB__(v61, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 v29 = v61 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8748 v61 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8749 if ( v29 ^ v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8750 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8751 v36 = *(&v50[v49 & (v31 >> 16)] + ((v47 & (unsigned int)v32) >> v48));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752 v31 += v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 v37 = v51[v36];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 v32 += v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 v34 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 v35 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 *v33 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 v33[1] = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 v33[640] = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 v33[641] = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 v63 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8762 v34[2] = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 v34[3] = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764 v34[642] = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 v34[643] = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 *v34 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 v34[1] = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769 v34[640] = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8770 v34[641] = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8771 v38 = v49 & (v31 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8772 v33 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8773 v31 += v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8774 v39 = v51[*(&v50[v38] + ((v47 & (unsigned int)v32) >> v48))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8775 v32 += v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8776 *(v33 - 2) = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8777 *(v33 - 1) = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8778 v33[638] = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8779 v33[639] = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8782 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8784 v58 = &pBLVRenderParams->pRenderTarget[v19 + v12 * pRenderer->uTargetSurfacePitch];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8785 v62 = &pBLVRenderParams->pTargetZBuffer[v56 + v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786 v20 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8787 v21 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8788 v22 = (int)v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8789 if ( v61 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8791 --v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8792 v22 = (int)(v58 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8793 v23 = &pBLVRenderParams->pTargetZBuffer[v56 + v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8794 v24 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8795 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8796 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8800 v30 = __OFSUB__(v61, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8801 v29 = v61 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8802 v61 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8803 if ( v29 ^ v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8804 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8805 v25 = *(&v50[v49 & (v20 >> 16)] + ((v47 & (unsigned int)v21) >> v48));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806 v20 += v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8807 v26 = v51[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8808 v21 += v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8809 v23 = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8810 v24 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8811 *(short *)v22 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8812 v62 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8813 v23[1] = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8814 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 *v23 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816 v27 = v49 & (v20 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 v22 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8818 v20 += v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 v28 = v51[*(&v50[v27] + ((v47 & (unsigned int)v21) >> v48))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 v21 += v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8821 *(short *)(v22 - 2) = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8824 ++v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 v56 += 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 v55 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8828 if ( v60 > stru_F8A590.field_4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8829 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8830 v13 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8831 v12 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 //----- (004AE1E7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841 int __fastcall sub_4AE1E7(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8843 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8844 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8845 int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8846 signed __int64 v6; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8847 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8848 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8849 int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8850 int v10; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8851 int v11; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8852 int v12; // [sp+1Ch] [bp+8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 v3 = pBLVRenderParams->uViewportCenterY - a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8855 v4 = pBLVRenderParams->uViewportCenterX - a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8856 v11 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8857 v5 = (pBLVRenderParams->uViewportCenterY - a3) * stru_F8AD28.vec_80.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8858 + stru_F8AD28.field_7C
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8859 + (pBLVRenderParams->uViewportCenterX - a2) * stru_F8AD28.vec_80.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8860 if ( v5 && (v12 = abs(stru_F8AD28.vec_80.z) >> 14, v12 <= abs(v5)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8862 LODWORD(v6) = stru_F8AD28.vec_80.z << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 HIDWORD(v6) = stru_F8AD28.vec_80.z >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8864 v7 = v6 / (v3 * stru_F8AD28.vec_80.y + stru_F8AD28.field_7C + v4 * stru_F8AD28.vec_80.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8866 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8868 v7 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870 v8 = stru_F8AD28.vec_9C.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 stru_F83B80[v11].field_0 = ((unsigned __int64)((v3 * stru_F8AD28.vec_8C.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8872 + stru_F8AD28.vec_8C.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8873 + v4 * stru_F8AD28.vec_8C.y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8874 * (signed __int64)v7) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8875 + stru_F8AD28.field_98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 result = (unsigned __int64)((v3 * v8 + stru_F8AD28.vec_9C.x + v4 * stru_F8AD28.vec_9C.y) * (signed __int64)v7) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877 v10 = result + stru_F8AD28.field_A8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8878 stru_F83B80[v11].field_28 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8879 stru_F83B80[v11].field_4 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8882
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8883 //----- (004AE313) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8884 int __fastcall sub_4AE313(int viewport_space_x, int viewport_space_y, stru337_stru0 *p)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886 int _dy; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887 int _dx; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 int v5; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 int v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890 int v7; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8891 signed __int64 v8; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8892 unsigned int v9; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8893 int result; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894 int v11; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8895
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 _dy = pBLVRenderParams->uViewportCenterY - viewport_space_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 _dx = pBLVRenderParams->uViewportCenterX - viewport_space_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 ++pBLVRenderParams->field_88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8899 v5 = (pBLVRenderParams->uViewportCenterY - viewport_space_y) * stru_F8AD28.vec_80.y + stru_F8AD28.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8900 v6 = v5 + _dx * stru_F8AD28.vec_80.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8901 v11 = v5 + _dx * stru_F8AD28.vec_80.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8902 if ( v5 + _dx * stru_F8AD28.vec_80.x && (v7 = abs(stru_F8AD28.vec_80.z) >> 14, v7 <= abs(v6)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 LODWORD(v8) = stru_F8AD28.vec_80.z << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905 HIDWORD(v8) = stru_F8AD28.vec_80.z >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 v9 = v8 / v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8908 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910 v9 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8912 if ( (signed int)v9 >= stru_F8AD28.field_34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8913 p->field_0 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8914 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8915 p->field_0 = stru_F8AD28.field_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8916 p->field_4 = ((unsigned __int64)((_dy * stru_F8AD28.vec_8C.z + stru_F8AD28.vec_8C.x + _dx * stru_F8AD28.vec_8C.y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8917 * (signed __int64)(signed int)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918 + stru_F8AD28.field_98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8919 + (stru_F8AD28.pDeltaUV[0] << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8920 p->field_8 = ((unsigned __int64)((_dy * stru_F8AD28.vec_9C.z + stru_F8AD28.vec_9C.x + _dx * stru_F8AD28.vec_9C.y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8921 * (signed __int64)(signed int)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8922 + stru_F8AD28.field_A8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923 + (stru_F8AD28.pDeltaUV[1] << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 result = abs((__int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)(signed int)v9) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 if ( result < 369620 || bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8927 if ( result < 184810 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8928 p->field_10 = result > 92405;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8929 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930 p->field_10 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8934 p->field_10 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8936 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8939 //----- (004AE491) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8940 int __fastcall sub_4AE491(signed int a1, signed int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8942 signed int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8943 signed int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8944 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8945 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8946 int v6; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8947 int v7; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8948 unsigned int v8; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8949 int v9; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8950 int v10; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8951 unsigned int v11; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952 int v13; // [sp+4h] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8953 int v14; // [sp+8h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8954 signed int v15; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 int v16; // [sp+14h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8956 int v17; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8957
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8958 v2 = a1 >> SLOBYTE(stru_F8AD28.field_38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8959 v3 = a2 >> SLOBYTE(stru_F8AD28.field_38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8960 v17 = stru_F8AD28.field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8961 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8962 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8963 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964 if ( stru_F8AD28.field_AC > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8966 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8968 v5 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 v13 = abs(v2 - stru_F8AD28._blv_lights_xs[v16]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8970 v14 = abs(v3 - stru_F8AD28._blv_lights_ys[v16]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8971 v6 = stru_F8AD28._blv_lights_light_dot_faces[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 v7 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973 v8 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974 if ( v6 < v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 v6 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 v7 = stru_F8AD28._blv_lights_light_dot_faces[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979 if ( v6 < v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 v9 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 v6 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 v8 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 if ( v7 < (signed int)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 v7 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991 v11 = ((unsigned int)(11 * v7) >> 5) + (v8 >> 2) + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992 if ( (signed int)v11 < stru_F8AD28._blv_lights_radii[v5] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 v17 += 30 * (v11 * stru_F8AD28._blv_lights_inv_radii[v5] - 65536);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 v2 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 while ( v16 < stru_F8AD28.field_AC );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000 if ( stru_F8AD28.field_3E4 != v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 v17 -= stru_F8AD28.field_3E8 * (v2 - stru_F8AD28.field_3F0) + stru_F8AD28.field_3EC * (v3 - stru_F8AD28.field_3F4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 if ( v17 >= v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 if ( v17 > 2031616 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 v17 = 2031616;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9007 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9009 v17 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9011 ++pBLVRenderParams->field_8C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9012 return v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9014 // 4AE491: using guessed type int __fastcall sub_4AE491(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9015
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9016
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9017
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9018
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9019 //----- (004AE5F1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9020 void __fastcall sub_4AE5F1(unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9022 BLVFace *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9023 BLVFaceExtra *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9024 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9025 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9026 Texture *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9027 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9028 unsigned int v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9029 unsigned int v8; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9030 unsigned int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9031 unsigned int v10; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9032 int v11; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9033 int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9034 int v13; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9035 int v14; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9036 int v15; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9037 double v16; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9038 int v17; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9039 char *v18; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9040 int v19; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9041 int v20; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9042 int v21; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9043 int v22; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9044 int v23; // ST04_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9045 int v24; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9046 double v25; // st6@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9047 int v26; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9048 double v27; // st6@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9049 int v28; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9050 char v29; // al@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9051 int v30; // edx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9052 int v31; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9053 BLVLightMM7 *v32; // ecx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9054 int v33; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9055 int v34; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9056 int v35; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9057 int v36; // edi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9058 int v37; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9059 int v38; // ebx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9060 int v39; // edi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9061 int v40; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9062 char *v41; // ebx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9063 signed int v42; // ecx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9064 int v43; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9065 int v44; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9066 int v45; // edx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9067 int v46; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9068 int v47; // ST04_4@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9069 int v48; // edi@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9070 double v49; // st6@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9071 int v50; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9072 double v51; // st6@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9073 int v52; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9074 int v53; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9075 int v54; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9076 int v55; // ecx@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9077 int v56; // edx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9078 int v57; // ecx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9079 int v58; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9080 int v59; // edx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9081 int v60; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9082 int v61; // edx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9083 int v62; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9084 int v63; // edx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9085 signed int v64; // ecx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9086 double v65; // st7@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9087 Vec3_int_ v66; // [sp+Ch] [bp-34h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9088 Vec3_int_ v67; // [sp+18h] [bp-28h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9089 BLVFaceExtra *v68; // [sp+24h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9090 int v69; // [sp+28h] [bp-18h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9091 int v70; // [sp+2Ch] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9092 int X; // [sp+30h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9093 int v72; // [sp+34h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9094 int v73; // [sp+38h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9095 int v74; // [sp+3Ch] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9097 v1 = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9098 v2 = &pIndoor->pFaceExtras[v1->uFaceExtraID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9099 v3 = v1->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9100 v4 = v1->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9101 v68 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9102 v5 = (Texture *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9103 v6 = 8 * uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9104 LOBYTE(v6) = 8 * uFaceID | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9105 stru_F8AD28.field_0 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9106 stru_F8AD28.plane_4.vNormal.x = v1->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9107 stru_F8AD28.plane_4.vNormal.y = v1->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9108 stru_F8AD28.plane_4.vNormal.z = v1->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9109 stru_F8AD28.plane_4.dist = v1->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9110 stru_F8AD28.pDeltaUV[0] = v2->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9111 stru_F8AD28.pDeltaUV[1] = v2->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9112 v7 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9113 v8 = v1->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9114 v9 = v7 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9115 if ( v8 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9117 stru_F8AD28.pDeltaUV[1] -= v9 & v5->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121 if ( v8 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122 stru_F8AD28.pDeltaUV[1] += v9 & v5->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124 v10 = v1->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9125 if ( BYTE1(v10) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127 stru_F8AD28.pDeltaUV[0] -= v9 & v5->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 if ( v10 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132 stru_F8AD28.pDeltaUV[0] += v9 & v5->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134 v1->_get_normals(&v67, &v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135 stru_F8AD28.vec_14.x = v67.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136 stru_F8AD28.vec_14.y = v67.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 stru_F8AD28.vec_14.z = v67.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 stru_F8AD28.vec_20.x = v66.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 stru_F8AD28.vec_20.y = v66.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 stru_F8AD28.vec_20.z = v66.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 stru_F8AD28.field_3F8 = v2->field_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 v74 = (unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)pBLVRenderParams->sSineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145 v74 = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 X = (unsigned __int64)(stru_F8AD28.plane_4.vNormal.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147 stru_F8AD28.rotated_normal.x = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148 stru_F8AD28.rotated_normal.y = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149 * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150 + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151 * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152 stru_F8AD28.rotated_normal.z = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 v70 = (unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sSineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156 v74 = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157 v70 = (unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 stru_F8AD28.vec_60.y = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159 stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9161 stru_F8AD28.field_6C = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9162 + ((unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9163 v70 = (unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sSineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164 v74 = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 X = (unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166 v72 = (unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 v70 = (unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 stru_F8AD28.vec_70.x = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170 + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171 stru_F8AD28.vec_70.z = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172 + ((unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173 v74 = pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 - pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 v11 = -(pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176 + pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 v73 = -65536 * pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178 v70 = (unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 v12 = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180 v69 = (unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181 v13 = pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 v70 = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 + ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184 v14 = pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 v70 = (unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)pBLVRenderParams->sSineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189 stru_F8AD28.rotated_normal.x = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191 - v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 stru_F8AD28.rotated_normal.z = stru_F8AD28.plane_4.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193 stru_F8AD28.rotated_normal.y = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196 * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 v70 = (unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sSineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 stru_F8AD28.vec_60.y = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 - v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 stru_F8AD28.field_6C = stru_F8AD28.vec_14.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201 stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202 + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203 v70 = (unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sSineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 stru_F8AD28.vec_70.x = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 - v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206 v69 = (unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207 v14 = pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208 stru_F8AD28.vec_70.z = stru_F8AD28.vec_20.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209 v13 = pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211 + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212 v12 = pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213 - pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214 v11 = -(pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215 + pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216 v70 = -65536 * pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 stru_F8AD28.field_7C = stru_F8AD28.rotated_normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 stru_F8AD28.vec_60.x = stru_F8AD28.plane_4.vNormal.z * pBLVRenderParams->vPartyPos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 + stru_F8AD28.plane_4.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221 + stru_F8AD28.plane_4.vNormal.y * v13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 + stru_F8AD28.plane_4.vNormal.x * v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223 stru_F8AD28.vec_80.x = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224 * (signed __int64)stru_F8AD28.rotated_normal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225 stru_F8AD28.vec_80.y = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 * (signed __int64)stru_F8AD28.rotated_normal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227 stru_F8AD28.vec_80.z = -stru_F8AD28.vec_60.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9228 stru_F8AD28.vec_8C.x = stru_F8AD28.vec_60.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9229 stru_F8AD28.vec_8C.y = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)stru_F8AD28.vec_60.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9230 stru_F8AD28.vec_8C.z = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)stru_F8AD28.field_6C) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9231 X = (unsigned __int64)(stru_F8AD28.vec_60.y * (signed __int64)v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232 v15 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 v70 = (unsigned __int64)(stru_F8AD28.field_6C * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 stru_F8AD28.vec_9C.x = stru_F8AD28.vec_70.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 stru_F8AD28.field_98 = -(X + ((unsigned __int64)(stru_F8AD28.vec_60.z * (signed __int64)v11) >> 16) + v70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236 stru_F8AD28.vec_9C.y = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)stru_F8AD28.vec_70.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 stru_F8AD28.vec_9C.z = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)stru_F8AD28.vec_70.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238 X = (unsigned __int64)(stru_F8AD28.vec_70.x * (signed __int64)v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 v69 = (unsigned __int64)(stru_F8AD28.vec_70.y * (signed __int64)v11) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240 v70 = (unsigned __int64)(stru_F8AD28.vec_70.z * (signed __int64)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 stru_F8AD28.field_38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242 stru_F8AD28.field_A8 = -(X
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 + ((unsigned __int64)(stru_F8AD28.vec_70.y * (signed __int64)v11) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244 + ((unsigned __int64)(stru_F8AD28.vec_70.z * (signed __int64)v15) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245 if ( *(int *)&v68->field_4 || *(int *)&v68->field_8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247 stru_F8AD28.field_3E4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248 stru_F8AD28.field_3E8 = *(int *)&v68->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 stru_F8AD28.field_3EC = *(int *)&v68->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 stru_F8AD28.field_3F0 = v68->field_1E;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 stru_F8AD28.field_3F4 = v68->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255 stru_F8AD28.field_3E4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257 v16 = 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 v17 = 116 * v1->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259 v69 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260 v74 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 stru_F8AD28.field_2C = (stru_F8AD28.field_3F8 + *(__int16 *)((char *)&pIndoor->pSectors->uMinAmbientLightLevel + v17)) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263 v70 = uNumMobileLightsApplied;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264 if ( uNumMobileLightsApplied > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 v18 = (char *)&pMobileLights[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269 if ( v74 >= 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271 v19 = *((short *)v18 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272 v20 = *((short *)v18 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 if ( v20 > v1->pBounding.x1 - v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 if ( v20 < v19 + v1->pBounding.x2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277 v21 = *(short *)v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278 if ( v21 > v1->pBounding.y1 - v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280 if ( v21 < v19 + v1->pBounding.y2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282 v22 = *((short *)v18 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 if ( v22 > v1->pBounding.z1 - v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285 if ( v22 < v19 + v1->pBounding.z2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287 X = (v1->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288 + *((short *)v18 + 1) * v1->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 + v21 * v1->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 + *((short *)v18 - 1) * v1->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 if ( X <= v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 v23 = X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294 v24 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 stru_F8AD28._blv_lights_radii[v74] = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 stru_F8AD28._blv_lights_inv_radii[v24] = 65536 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297 *(int *)((char *)&stru_F8AD28.field_240 + v24 * 4) = *((short *)v18 + 5) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298 stru_F8AD28._blv_lights_xs[v24] = *((short *)v18 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299 stru_F8AD28._blv_lights_ys[v24] = *(short *)v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 stru_F8AD28._blv_lights_zs[v24] = *((short *)v18 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 v68 = (BLVFaceExtra *)(unsigned __int8)v18[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 v25 = (double)(signed int)v68 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303 v68 = (BLVFaceExtra *)(unsigned __int8)v18[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 v26 = (unsigned __int8)v18[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 *(float *)(v24 * 4 + 16297992) = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306 v27 = (double)(signed int)v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307 v68 = (BLVFaceExtra *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 *(float *)(v24 * 4 + 16298072) = v27 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309 *(float *)(v24 * 4 + 16298152) = (double)(signed int)v68 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310 v16 = 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 stru_F8AD28._blv_lights_light_dot_faces[v24] = abs(v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312 v28 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313 v29 = v18[9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9314 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 stru_F8AD28._blv_lights_smthngs[v28] = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9323 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324 v18 += 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325 v17 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327 while ( v73 < v70 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331 v31 = *(__int16 *)((char *)&pIndoor->pSectors->uNumLights + v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 v70 = *(__int16 *)((char *)&pIndoor->pSectors->uNumLights + v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333 if ( v31 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335 while ( v74 < 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337 v32 = &pIndoor->pLights[*(&(*(BLVLightMM7 **)((char *)&pIndoor->pSectors->pLights + v17))->vPosition.x + v30)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 if ( !(v32->uAtributes & 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340 v33 = v1->pBounding.x1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 v34 = v32->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342 X = v32->uBrightness;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9343 v35 = v32->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9344 v68 = (BLVFaceExtra *)v32->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9345 if ( v34 > v33 - v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347 if ( v34 < v35 + v1->pBounding.x2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349 v36 = v32->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 if ( v36 > v1->pBounding.y1 - v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352 if ( v36 < v35 + v1->pBounding.y2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354 v37 = v32->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 if ( v37 > v1->pBounding.z1 - v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357 if ( v37 < v35 + v1->pBounding.z2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 v38 = (v1->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 + v32->vPosition.x * v1->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 + v37 * v1->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362 + v36 * v1->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 if ( v38 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 if ( v38 <= v35 && v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 v39 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368 stru_F8AD28._blv_lights_radii[v74] = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 stru_F8AD28._blv_lights_inv_radii[v39] = 65536 / (signed int)v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370 *(int *)((char *)&stru_F8AD28.field_240 + v39 * 4) = X << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 stru_F8AD28._blv_lights_xs[v39] = v32->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 stru_F8AD28._blv_lights_ys[v39] = v32->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373 stru_F8AD28._blv_lights_zs[v39] = v32->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 v68 = (BLVFaceExtra *)v32->uRed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 stru_F8AD28._blv_lights_rs[v39] = (double)(signed int)v68 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 v68 = (BLVFaceExtra *)v32->uGreen;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377 stru_F8AD28._blv_lights_gs[v39] = (double)(signed int)v68 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 v68 = (BLVFaceExtra *)v32->uBlue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379 stru_F8AD28._blv_lights_bs[v39] = (double)(signed int)v68 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 v16 = 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 stru_F8AD28._blv_lights_light_dot_faces[v39] = abs(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 v40 = v74++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383 stru_F8AD28._blv_lights_smthngs[v40] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 v30 = v73++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394 if ( v73 >= v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396 v17 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 if ( uNumStationaryLightsApplied > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 v41 = (char *)&pStationaryLights[0].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 if ( v74 >= 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 v42 = *((short *)v41 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 v43 = *((short *)v41 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 if ( v43 > v1->pBounding.x1 - v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 if ( v43 < v42 + v1->pBounding.x2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 v44 = *(short *)v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 if ( v44 > v1->pBounding.y1 - v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 if ( v44 < v42 + v1->pBounding.y2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 v45 = *((short *)v41 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 if ( v45 > v1->pBounding.z1 - v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9421 if ( v45 < v42 + v1->pBounding.z2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 v46 = (v1->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 + *(short *)v41 * v1->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 + v43 * v1->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 + v45 * v1->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 v69 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 if ( v46 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 if ( v46 <= v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 v47 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 v48 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 stru_F8AD28._blv_lights_radii[v74] = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 stru_F8AD28._blv_lights_inv_radii[v48] = 65536 / v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 stru_F8AD28._blv_lights_xs[v48] = *((short *)v41 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 stru_F8AD28._blv_lights_ys[v48] = *(short *)v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 stru_F8AD28._blv_lights_zs[v48] = *((short *)v41 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 v68 = (BLVFaceExtra *)(unsigned __int8)v41[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 v49 = (double)(signed int)v68 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 v68 = (BLVFaceExtra *)(unsigned __int8)v41[7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 v50 = (unsigned __int8)v41[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 stru_F8AD28._blv_lights_rs[v48] = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 v51 = (double)(signed int)v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 v68 = (BLVFaceExtra *)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 stru_F8AD28._blv_lights_gs[v48] = v51 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 stru_F8AD28._blv_lights_bs[v48] = (double)(signed int)v68 * v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 v16 = 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 stru_F8AD28._blv_lights_light_dot_faces[v48] = abs(v47);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 v52 = v74++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 stru_F8AD28._blv_lights_smthngs[v52] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461 v41 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463 while ( v73 < uNumStationaryLightsApplied );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465 stru_F8AD28.field_AC = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466 v53 = v1->pBounding.x2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467 if ( pBLVRenderParams->vPartyPos.x <= v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 v55 = v1->pBounding.x1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 if ( pBLVRenderParams->vPartyPos.x >= v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 v54 = v55 - pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 v54 = pBLVRenderParams->vPartyPos.x - v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 v56 = v1->pBounding.y2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 v57 = v54 * v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 if ( pBLVRenderParams->vPartyPos.y <= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 v59 = v1->pBounding.y1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 if ( pBLVRenderParams->vPartyPos.y >= v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 v58 = v59 - pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 v58 = pBLVRenderParams->vPartyPos.y - v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493 v60 = v58 * v58 + v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 v61 = v1->pBounding.z2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 if ( pBLVRenderParams->vPartyPos.z <= v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 v63 = v1->pBounding.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 if ( pBLVRenderParams->vPartyPos.z >= v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9500 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9501 v62 = v63 - pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 v62 = pBLVRenderParams->vPartyPos.z - v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 v64 = v62 * v62 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 if ( v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 stru_F8AD28.field_34 = sub_452A9E(v64) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 stru_F8AD28.field_34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 v68 = (BLVFaceExtra *)abs(stru_F8AD28.rotated_normal.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 v65 = (double)(signed int)v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 if ( v65 >= 655.36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 if ( v65 >= 26214.4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 if ( v65 >= 45875.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 stru_F8AD28.field_44 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 stru_F8AD28.field_48 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525 stru_F8AD28.field_44 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526 stru_F8AD28.field_48 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531 stru_F8AD28.field_44 = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532 stru_F8AD28.field_48 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 stru_F8AD28.field_44 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 stru_F8AD28.field_48 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541 // 519AB4: using guessed type int uNumStationaryLightsApplied;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 //----- (004AF412) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 int __cdecl sub_4AF412()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546 int v0; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547 int v1; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548 int v2; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549 int v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550 int v4; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 int v6; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 int v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 int v8; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 int v9; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 stru_F8AD28.plane_4.vNormal.z = -65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 stru_F8AD28.vec_20.y = -65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9560 stru_F8AD28.plane_4.vNormal.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9561 stru_F8AD28.plane_4.vNormal.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562 stru_F8AD28.plane_4.dist = (pBLVRenderParams->vPartyPos.z + 800) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 stru_F8AD28.vec_14.x = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564 stru_F8AD28.vec_14.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 stru_F8AD28.vec_14.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9566 stru_F8AD28.vec_20.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9567 stru_F8AD28.vec_20.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 stru_F8AD28.field_3F8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 v0 = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 - ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 stru_F8AD28.rotated_normal.x = ((unsigned __int64)(v0 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 - ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 stru_F8AD28.rotated_normal.y = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 stru_F8AD28.rotated_normal.z = ((unsigned __int64)(v0 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9581 + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9582 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9583 v1 = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9584 - ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585 stru_F8AD28.vec_60.y = ((unsigned __int64)(v1 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586 - ((unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587 stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 stru_F8AD28.field_6C = ((unsigned __int64)(v1 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 + ((unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 v2 = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 - ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593 stru_F8AD28.vec_70.x = ((unsigned __int64)(v2 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594 - ((unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595 stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596 + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597 stru_F8AD28.vec_70.z = ((unsigned __int64)(v2 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598 + ((unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599 v3 = -(pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600 + pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601 v4 = pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602 - pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603 v5 = ((unsigned __int64)(v4 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604 - ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605 v6 = pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 v7 = ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607 + ((unsigned __int64)(v4 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608 v8 = pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609 v9 = pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613 stru_F8AD28.rotated_normal.x = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614 * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 - ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 stru_F8AD28.rotated_normal.z = stru_F8AD28.plane_4.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618 stru_F8AD28.rotated_normal.y = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619 * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622 stru_F8AD28.vec_60.y = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9623 - ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9624 stru_F8AD28.field_6C = stru_F8AD28.vec_14.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9625 stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 stru_F8AD28.vec_70.x = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628 - ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sSineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 v8 = pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 stru_F8AD28.vec_70.z = stru_F8AD28.vec_20.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 v9 = pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 v5 = pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 - pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 v6 = pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 v3 = -(pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 + pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639 v7 = -65536 * pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641 stru_F8AD28.field_7C = stru_F8AD28.rotated_normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9642 stru_F8AD28.vec_60.x = stru_F8AD28.plane_4.vNormal.y * v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9643 + stru_F8AD28.plane_4.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9644 + stru_F8AD28.plane_4.vNormal.x * v9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 + stru_F8AD28.plane_4.vNormal.z * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 stru_F8AD28.vec_80.x = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 * (signed __int64)stru_F8AD28.rotated_normal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9648 stru_F8AD28.vec_80.y = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9649 * (signed __int64)stru_F8AD28.rotated_normal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9650 stru_F8AD28.vec_80.z = -stru_F8AD28.vec_60.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9651 stru_F8AD28.vec_8C.x = stru_F8AD28.vec_60.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9652 stru_F8AD28.vec_8C.y = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)stru_F8AD28.vec_60.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9653 stru_F8AD28.vec_8C.z = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)stru_F8AD28.field_6C) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9654 stru_F8AD28.vec_9C.x = stru_F8AD28.vec_70.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 stru_F8AD28.field_98 = -(((unsigned __int64)(stru_F8AD28.vec_60.y * (signed __int64)v5) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 + ((unsigned __int64)(stru_F8AD28.vec_60.z * (signed __int64)v3) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 + ((unsigned __int64)(stru_F8AD28.field_6C * (signed __int64)v7) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 stru_F8AD28.vec_9C.y = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)stru_F8AD28.vec_70.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 stru_F8AD28.vec_9C.z = (unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)stru_F8AD28.vec_70.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 stru_F8AD28.field_A8 = -(((unsigned __int64)(stru_F8AD28.vec_70.x * (signed __int64)v5) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 + ((unsigned __int64)(stru_F8AD28.vec_70.y * (signed __int64)v3) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9663 + ((unsigned __int64)(stru_F8AD28.vec_70.z * (signed __int64)v7) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9664 stru_F8AD28.field_38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9665 stru_F8AD28.field_3E4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9666 stru_F8AD28.field_2C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9667 stru_F8AD28.field_AC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668 stru_F8AD28.field_34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 //----- (004B1447) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 Player *__fastcall sub_4B1447_party_fine(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680 signed int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 char v4; // sf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 unsigned __int64 v6; // qax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 DDM_DLV_Header *v7; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685 Player **v8; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686 Player *result; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 char *v10; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 if ( a2 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694 if ( a2 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695 v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 if ( pParty->uFine < 4000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 v4 = a3 + pParty->uFine < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707 v5 = a3 + pParty->uFine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708 pParty->uFine += a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 pParty->uFine = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 if ( v5 > 4000000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 pParty->uFine = 4000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717 v6 = pParty->uTimePlayed + 368640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 pParty->field_3C._shop_ban_times[2 * a1] = LODWORD(pParty->uTimePlayed) + 368640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 pParty->field_3C._shop_ban_times[2 * a1 + 1] = HIDWORD(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 *(int *)&pParty->field_16154[4 * a1] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 v7 = &pOutdoor->ddm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 v7 = &pIndoor->dlv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 v7->uReputation += v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728 if ( v7->uReputation > 10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 v7->uReputation = 10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 v8 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 result = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735 if ( pParty->uFine )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 v10 = result->field_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 result = (Player *)_449B57_test_bit((unsigned __int8 *)result->field_152, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 if ( !(short)result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 result = (Player *)_449B7E_toggle_bit(v10, 1, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 while ( (signed int)v8 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 //----- (004B1523) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 char *__thiscall sub_4B1523(int *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 LONG v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756 int v6; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 char *v7; // ST44_4@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 unsigned __int16 v8; // ax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 GUIWindow a1; // [sp+Ch] [bp-68h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 unsigned int v11; // [sp+60h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 POINT a2; // [sp+64h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 int v13; // [sp+6Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 int v14; // [sp+70h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 v1 = *_this - 399;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 v2 = (*_this - 400) % 11 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 v11 = 4 * (*_this - 400) / 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 sprintfex(pTmpBuf, "%s%03d", spellbook_texture_filename_suffices[v11 / 4], v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 if ( pMouse->GetCursorPos(&a2)->y <= 320 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 v3 = pMouse->GetCursorPos(&a2)->y + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 v3 = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 a1.str_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 a1.uFrameY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 a1.uFrameWidth = 328;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 a1.uFrameHeight = 68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 a1.uFrameX = 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 a1.uFrameZ = 417;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 a1.uFrameW = v3 + 67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 a2.y = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 v14 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 v13 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784 v5 = a2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 if ( v14 > a2.y )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786 v5 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787 if ( v13 > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 v5 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 if ( v4 > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 sprintfex(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 pTmpBuf2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794 pSpellStats->pInfos[v1].pDescription,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 pGlobalTXT_LocalizationStrings[431], // "Normal"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 v5 + 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 v5 + 10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 pSpellStats->pInfos[v1].pBasicSkillDesc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 pGlobalTXT_LocalizationStrings[433], // "Expert"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 v5 + 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 v5 + 10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 pSpellStats->pInfos[v1].pExpertSkillDesc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 pGlobalTXT_LocalizationStrings[432], // "Master"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 v5 + 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 v5 + 10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 pSpellStats->pInfos[v1].pMasterSkillDesc,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 pGlobalTXT_LocalizationStrings[96], // "Grand"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 v5 + 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9809 v5 + 10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9810 pSpellStats->pInfos[v1].pGrandmasterSkillDesc);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9811 v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2, &a1, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9812 a1.uFrameHeight += v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 if ( (signed int)a1.uFrameHeight < 150 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 a1.uFrameHeight = 150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 a1.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 a1._415551(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817 a1.uFrameWidth -= 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 a1.uFrameHeight -= 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 v7 = pSpellStats->pInfos[v1].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823 a1.DrawText2(pFontArrus, 0x78u, 0xCu, v8, v7, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 a1.uFrameZ = a1.uFrameX + 107;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 a1.uFrameWidth = 108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 a1.DrawText2(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v11 / 4 + 12], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828 sprintfex(pTmpBuf, "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * v1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 return a1.DrawText2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 pFontComic,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 0xCu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832 a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 //----- (004B1784) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 bool __cdecl sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 Player *pPlayer; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 unsigned __int16 v2; // ST0C_2@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 GUIWindow v4; // [sp+4h] [bp-54h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 pPlayer = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849 if ( pPlayer->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851 pDialogueWindow->field_28 = dword_F8B1E0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 pDialogueWindow->field_28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857 memcpy(&v4, pGUIWindow0, sizeof(v4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858 v4.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 v4.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 v4.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[427], pPlayer->pName, pGlobalTXT_LocalizationStrings[562]);//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 // "%s is in no condition to %s"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863 // "do anything"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 v3 = pFontArrus->CalcTextHeight(pTmpBuf, &v4, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 v4.DrawText2(pFontArrus, 0, (212 - v3) / 2 + 101, v2, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 // F8B1E0: using guessed type int dword_F8B1E0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 //----- (004B1A2D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 void __cdecl sub_4B1A2D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878 Player *v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879 POINT *v1; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880 unsigned int v2; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881 int v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 POINT *v4; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 int v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 unsigned int v6; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 ItemGen *v7; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 signed int v8; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 unsigned int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 char v10; // [sp+8h] [bp-44h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 char v11; // [sp+10h] [bp-3Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 char v12; // [sp+18h] [bp-34h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 char v13; // [sp+20h] [bp-2Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 char v14; // [sp+28h] [bp-24h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 char v15; // [sp+30h] [bp-1Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894 char v16; // [sp+38h] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 POINT a2; // [sp+40h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 int v18; // [sp+48h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 if ( dword_F8B198 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 if ( dword_F8B198 <= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 if ( dword_F8B19C <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 if ( dword_F8B19C <= 5 || dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 v8 = pMouse->GetCursorPos((POINT *)&v15)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos((POINT *)&v14)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 if ( pMouse->GetCursorPos((POINT *)&v13)->x <= 13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 || pMouse->GetCursorPos((POINT *)&v12)->x >= 462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 || (v9 = v0->GetItemIDAtInventoryIndex(&v18)) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 return;
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
9915 v7 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v9 + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 GameUI_DrawItemInfo(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923 v4 = pMouse->GetCursorPos((POINT *)&v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 v5 = pRenderer->pActiveZBuffer[v4->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v10)->y]] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 v18 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 v6 = 9 * (v5 + 12 * (unsigned int)ptr_507BC0->ptr_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 v7 = (ItemGen *)((char *)&pParty->pPickedItem + 4 * v6 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 v7 = (ItemGen *)&pParty->field_C59C[v6 + 715];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 if ( dword_F8B198 <= 16 && dword_F8B19C == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 v1 = pMouse->GetCursorPos(&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 v2 = v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v16)->y];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 v3 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 v18 = pRenderer->pActiveZBuffer[v2] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 sub_4B1523((int *)&pParty->pPlayers[1].uExpressionTimeLength + 9 * (v3 + 12 * (unsigned int)ptr_507BC0->ptr_1C));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 // F8B198: using guessed type int dword_F8B198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 //----- (004B1BDB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 void __stdcall RestAndHeal(__int64 uNumMinutes)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 signed __int64 v1; // ST2C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 signed __int64 v2; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 signed __int64 v3; // ST1C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 unsigned __int64 v4; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 unsigned int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 void *v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 pParty->pHirelings[0].bHasUsedTheAbility = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 pParty->pHirelings[1].bHasUsedTheAbility = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 pParty->uTimePlayed += (signed __int64)((double)(7680 * uNumMinutes) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 v1 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 v2 = v1 / 60 / 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 v4 = (unsigned int)v2 / 0x18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 v5 = (unsigned int)(v4 / 7) >> 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 pParty->uCurrentTimeSecond = v1 % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 pParty->uCurrentMinute = v1 / 60 % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 pParty->uCurrentHour = v3 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 pParty->uCurrentMonthWeek = v4 / 7 & 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 pParty->uDaysPlayed = (unsigned int)v4 % 0x1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 pParty->uCurrentMonth = v5 % 0xC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 pParty->uCurrentYear = v5 / 0xC + 1168;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 pParty->RestAndHeal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 dword_507B94 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 v6 = &pParty->pPlayers[0].uNumDivineInterventionCastsThisDay;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9977 *((short *)v6 - 258) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9978 memset(v6, 0, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9979 v6 = (char *)v6 + 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 while ( (signed int)v6 < (signed int)&pParty->field_871C[694] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 pParty->_4909F4();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 // 507B94: using guessed type int dword_507B94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 //----- (004B1D27) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 void __cdecl sub_4B1D27()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 int v0; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 unsigned int v1; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 signed int v2; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 int v3; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 __int16 v4; // ax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 signed int v5; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 int v6; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 int v7[4]; // [sp+Ch] [bp-10h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 if ( dword_F8B198 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 v0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 if ( dword_F8B198 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 if ( dword_F8B198 == 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 if ( !dword_F8B1E4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 if ( dword_F8B198 != 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 v1 = (unsigned int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 HousePlaySomeSound(v1, v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 v1 = (unsigned int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 if ( (signed __int64)__PAIR__(pParty->field_3C._shop_ban_times[2 * v1 + 1], pParty->field_3C._shop_ban_times[2 * v1]) <= (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 if ( pParty->uNumGold <= 0x2710 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10023 if ( !dword_F8B1E4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 v0 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028 HousePlaySomeSound(v1, dword_F8B1E4 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029 if ( !dword_F8B1E4 && !qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 if ( pPlayers[v6]->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036 v7[v5++] = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 while ( v6 <= 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10040 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 qword_A750D8 = 256i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043 word_A750E0 = 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044 v4 = LOWORD(v7[rand() % v5]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 if ( !qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057 if ( pPlayers[v3]->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 v7[v2++] = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061 while ( v3 <= 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10064 qword_A750D8 = 256i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10065 word_A750E0 = 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10066 v4 = LOWORD(v7[rand() % v2]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10067 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 word_A750E2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076 //----- (004B1E92) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077 void __fastcall HousePlaySomeSound(unsigned int uHouseID, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080 if ( BYTE1(pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].field_C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081 pAudioPlayer->PlaySound(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082 //(SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * uHouseID]].field_C) + 300)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083 (SoundID)(a2 + 100 * (BYTE1(pAnimatedRooms[p2DEvents[uHouseID - 1].uAnimationID].field_C) + 300)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084 806,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086 -1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093 //----- (004B1ECE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 void __cdecl sub_4B1ECE()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096 __int16 *v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 int v1; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 Player *v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 int v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 signed int v4; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101 int v5; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 char *v6; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 char *v7; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 signed int v8; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 int v9; // [sp+Ch] [bp-Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106 signed int v10; // [sp+10h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107 int v11; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108 char *v12; // [sp+14h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110 dword_F8B1A8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 uDialogueType = 84;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10113 ptr_F8B1E8 = (char *)pNPCTopics[667].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, *(v0 - 1)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 v2 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123 LOBYTE(v3) = v2->CompareVariable(VAR_PlayerItemInHands, *v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 while ( (signed int)v2 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 if ( v1 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134 v0 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 if ( (signed int)v0 >= (signed int)((char *)dword_4F08EC + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10138 ptr_F8B1E8 = (char *)pNPCTopics[666].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 dword_F8B1A8 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 if ( dword_F8B1A8 == 601 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 v12 = (char *)&pParty->pPlayers[0].uClass;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 if ( *v12 == 35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 v6 = &pParty->pPlayers[0].pInventoryItems[0].field_1A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 v8 = 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 if ( *(int *)(v7 - 26) == 601 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162 if ( !*v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163 v9 = (int)(v7 - 26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164 if ( (unsigned __int8)*v7 == v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 v7 += 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 --v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 while ( v8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 v6 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 while ( (signed int)v6 < (signed int)((char *)&pParty->field_777C[91] + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 v12 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 if ( (signed int)v12 >= (signed int)((char *)&pParty->pPickedItem.uExpireTime + 5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 *(char *)(v9 + 26) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 // 4F08EC: using guessed type int dword_4F08EC[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187 // 722B3C: using guessed type int dword_722B3C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 // 722B44: using guessed type int dword_722B44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189 // F8B1A8: using guessed type int dword_F8B1A8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 //----- (004B2001) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 void __fastcall sub_4B2001(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 signed int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 NPCData *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196 int v3; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197 Player *v4; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 int v5; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199 int v6; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 int v7; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 int v8; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 int v9; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203 unsigned int v10; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 unsigned int v11; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 char *v12; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 char *v13; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 char *v14; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208 char *v15; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 unsigned int v16; // ebp@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 char *v17; // ecx@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 char *v18; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 const char *v19; // ecx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 unsigned int v20; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10214 unsigned int v21; // ecx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 char *v22; // [sp-Ch] [bp-18h]@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 int v23; // [sp-8h] [bp-14h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 char *v24; // [sp-8h] [bp-14h]@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 int v25; // [sp-4h] [bp-10h]@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10220 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 uDialogueType = a1 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 v2 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 if ( a1 <= 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 if ( a1 == 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10227 v3 = v2->evte;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10229 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231 if ( a1 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 ptr_F8B1E8 = (char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10234 ptr_F8B1E8 = sub_495461((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10235 sub_4B40E6();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 byte_F8B1EC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10237 goto _return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 switch ( a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 v3 = v2->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 v3 = v2->evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10247 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10248 v3 = v2->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10249 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10250 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 if ( a1 != 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 goto _return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10253 v3 = v2->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10254 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 goto LABEL_84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 if ( a1 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 v3 = v2->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262 LABEL_84:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 if ( v3 < 200 || v3 > 310 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 if ( v3 < 400 || v3 > 410 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 if ( v3 == 139 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 sub_4B1ECE();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273 if ( v3 == 311 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 sub_4BBA85_bounties();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 ptr_F8B1E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 _5C3420_pDecoration = (LevelDecoration *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 EventProcessor(v3, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10288 dword_F8B1D8 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10289 sub_4B3EF0(v3 - 400);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 sub_4B3FE5(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 goto _return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 if ( a1 != 76 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10300 if ( a1 == 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 v16 = v2->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 if ( byte_F8B1EC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 v17 = (char *)*(&pNPCStats->field_13A64 + 5 * v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 v17 = (char *)*(&pNPCStats->field_13A5C + 5 * v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 ptr_F8B1E8 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 v18 = sub_495461(v17, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 byte_F8B1EC ^= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 ptr_F8B1E8 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 if ( a1 == 79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 if ( dword_F8B1A8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 Party::TakeGold(dword_F8B1B4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 v12 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10322 *(short *)v12 &= 0x3Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10323 switch ( dword_F8B1B0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 v15 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 *v15 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 v14 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 *v14 |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 v13 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_something_todo_with_awards];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 v13[1] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 pPlayers[uActiveCharacter]->PlaySound(85, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10351 if ( a1 == 82 && dword_F8B1A8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 Party::TakeGold(dword_F8B1B4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 v4 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10357 v4->SetVariable(VAR_Award, dword_F8B1AC_something_todo_with_awards);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 while ( (signed int)v4 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 switch ( dword_F8B1D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 v10 = v2->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 if ( (signed int)v10 >= 400 && (signed int)v10 <= 416 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 v2->bDrawSomeAnim = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 v9 = v2->evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 if ( v9 >= 400 && v9 <= 416 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 v2->evtb = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10372 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10374 v8 = v2->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 if ( v8 >= 400 && v8 <= 416 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 v2->evtc = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 case 22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 v7 = v2->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 if ( v7 >= 400 && v7 <= 416 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 v2->evtd = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 v6 = v2->evte;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 if ( v6 >= 400 && v6 <= 416 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 v2->evte = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 v5 = v2->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 if ( v5 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 if ( v5 <= 416 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 v2->evtf = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404 v11 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 v23 = 86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 pPlayers[v11]->PlaySound(v23, v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 goto _return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416 goto _return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 v19 = pGlobalTXT_LocalizationStrings[533]; // ""I cannot join you, you're party is full""
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 LABEL_77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422 ShowStatusBarString(v19, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 goto _return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425 v20 = v2->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426 if ( v20 != 51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 v21 = *(&pNPCStats->field_13A58 + 5 * v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 if ( pParty->uNumGold < v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 byte_F8B1EC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 uDialogueType = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 ptr_F8B1E8 = (char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10435 ptr_F8B1E8 = sub_495461((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 pPlayers[uActiveCharacter]->PlaySound(38, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 v19 = pGlobalTXT_LocalizationStrings[155];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439 goto LABEL_77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441 Party::TakeGold(v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 LOBYTE(v2->uFlags) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 pParty->field_709 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445 sub_44A56A();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 if ( pParty->pHirelings[0].pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 memcpy(&pParty->pHirelings[1], v2, sizeof(pParty->pHirelings[1]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 v24 = v2->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 v22 = pParty->pHireling2Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 memcpy(pParty->pHirelings, v2, 0x4Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 v24 = v2->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 v22 = pParty->pHireling1Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 strcpy(v22, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 pParty->field_709 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 sub_44A56A();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 PrepareHouse((unsigned int)ptr_507BC0->ptr_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 dword_F8B19C = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 v11 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 v23 = 61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 _return:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 pVideoPlayer->_4BF5B2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10480
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 //----- (004B254D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 char *__thiscall _4B254D_SkillMasteryTeacher(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 Player *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 int v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 int v6; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 int v7; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 int v8; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 signed int v9; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 int v10; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 char *v11; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 int v12; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 char *v13; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498 signed int v14; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 unsigned int v16; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 int v17; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501 char v18; // cl@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502 __int16 v19; // dx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 int v20; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504 char *v21; // [sp-Ch] [bp-38h]@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 const char *v22; // [sp-8h] [bp-34h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 unsigned int v23; // [sp-8h] [bp-34h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 char *v24; // [sp-8h] [bp-34h]@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 char *v25; // [sp-4h] [bp-30h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 int v26; // [sp-4h] [bp-30h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510 int v27; // [sp-4h] [bp-30h]@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 char v28[4]; // [sp+Ch] [bp-20h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 int v29; // [sp+10h] [bp-1Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 int v30; // [sp+14h] [bp-18h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 int v31; // [sp+18h] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 unsigned __int16 a1[2]; // [sp+1Ch] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 int v33; // [sp+20h] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517 int v34; // [sp+24h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518 char *v35; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 v1 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521 dword_F8B1A8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522 v2 = (_this - 200) % 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 v3 = (_this - 200) / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 v4 = v2;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10525 v35 = (char *)pNPCTopics[127].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 dword_F8B1AC_something_todo_with_awards = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 dword_F8B1B4 = 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 dword_F8B1B0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 if ( v2 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 dword_F8B1B4 = 8000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 dword_F8B1B0 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 dword_F8B1B4 = 2000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 dword_F8B1B0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 v5 = v1->uClass;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 v33 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 v6 = byte_4ED970_skill_learn_ability_by_class_table[v5][v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 *(int *)a1 = v1->pActiveSkills[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 v7 = a1[0] & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10553 v34 = v2 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 if ( v6 < v2 + 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 v8 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 v10 = v33 - v33 % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 v11 = &byte_4ED970_skill_learn_ability_by_class_table[v33 - v33 % 4][v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 v12 = (unsigned __int8)*v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 v13 = &v28[4 * v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 *(int *)v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 if ( v12 < v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 v14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 v14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 *(int *)v13 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 v11 += 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 while ( v9 < 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 if ( v29 == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 v25 = pClassNames[v10 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 if ( v30 == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 if ( v31 == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 return pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 v25 = pClassNames[v10 + 2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 if ( v31 != v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 v25 = pClassNames[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 v22 = pGlobalTXT_LocalizationStrings[632];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601 v25 = pClassNames[v10 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604 v22 = pGlobalTXT_LocalizationStrings[633];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 sprintfex(pTmpBuf, v22, v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607 return pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609 if ( !v1->CanAct() )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10610 return (char *)pNPCTopics[122].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611 if ( !v7 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10612 return (char *)pNPCTopics[131].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613 v16 = SkillToMastery(a1[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614 if ( (signed int)v16 > v4 + 1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10615 return (char *)pNPCTopics[v4 + 128].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616 if ( v34 != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618 if ( v34 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620 if ( (signed int)v16 >= 2 && v7 >= 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622 v17 = dword_F8B1AC_something_todo_with_awards;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 switch ( dword_F8B1AC_something_todo_with_awards )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10628 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10629 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10630 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10631 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 dword_F8B1B4 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637 v19 = 114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 goto LABEL_57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 v19 = 110;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641 LABEL_57:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642 if ( !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 return v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 case 22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 v20 = v1->GetBaseWillpower();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647 goto LABEL_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649 dword_F8B1B4 = 2500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 v20 = v1->GetBaseEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 goto LABEL_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 v20 = v1->GetBaseIntelligence();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 LABEL_61:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655 if ( v20 < 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656 return v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10662 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664 case 34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 case 35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 dword_F8B1B4 = 2500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10668 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 dword_F8B1B4 = 3000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 goto LABEL_67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 goto LABEL_67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 if ( v34 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10685 v17 = dword_F8B1AC_something_todo_with_awards;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 if ( (signed int)v16 >= 3 && v7 >= 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 v17 = dword_F8B1AC_something_todo_with_awards;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 switch ( dword_F8B1AC_something_todo_with_awards )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 if ( v1->_49327B(0x22u, 1) == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 v23 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 if ( v1->_49327B(0x23u, 1) == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 v23 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 if ( v1->_49327B(v23, v26) == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 return v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 case 30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711 v18 = LOBYTE(v1->pActiveSkills[31]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 case 31:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 v18 = LOBYTE(v1->pActiveSkills[30]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 LABEL_47:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 if ( (v18 & 0x3Fu) < 0xA )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 return v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 case 34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 case 35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728 dword_F8B1B4 = 6000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 dword_F8B1B4 = 7000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10739 LABEL_67:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 dword_F8B1B4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 return v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746 if ( v7 < 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747 return v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 v17 = dword_F8B1AC_something_todo_with_awards;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 if ( dword_F8B1AC_something_todo_with_awards > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751 if ( dword_F8B1AC_something_todo_with_awards != 29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 && dword_F8B1AC_something_todo_with_awards != 32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 && (dword_F8B1AC_something_todo_with_awards <= 33 || dword_F8B1AC_something_todo_with_awards > 35) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 if ( !dword_F8B1B4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10760 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761 dword_F8B1B4 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10762 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764 if ( dword_F8B1AC_something_todo_with_awards >= 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766 if ( dword_F8B1AC_something_todo_with_awards == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768 dword_F8B1B4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 if ( dword_F8B1AC_something_todo_with_awards <= 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773 if ( dword_F8B1AC_something_todo_with_awards > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775 if ( dword_F8B1AC_something_todo_with_awards != 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779 dword_F8B1B4 = 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781 if ( dword_F8B1B4 > pParty->uNumGold )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10782 return (char *)pNPCTopics[124].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783 LABEL_79:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784 dword_F8B1A8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785 if ( v34 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787 v27 = dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788 v24 = pSkillNames[v17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789 v21 = pGlobalTXT_LocalizationStrings[433];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790 goto LABEL_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792 if ( v34 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794 v27 = dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795 v24 = pSkillNames[v17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796 v21 = pGlobalTXT_LocalizationStrings[432];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 goto LABEL_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 if ( v34 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801 v27 = dword_F8B1B4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 v24 = pSkillNames[v17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803 v21 = pGlobalTXT_LocalizationStrings[225];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804 LABEL_90:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[534], v21, v24, v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807 return pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812 //----- (004B29F2) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10813 const char *__fastcall sub_4B29F2(int a1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 Player *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818 Player *v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 dword_F8B1A8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822 v2 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 v3 = a1 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 v4 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 dword_F8B1AC_something_todo_with_awards = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 dword_F8B1B4 = dword_4F08EC[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 if ( v4->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)v2->field_152, dword_F8B1AC_something_todo_with_awards) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10831 return pNPCTopics[123].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835 if ( dword_F8B1B4 <= pParty->uNumGold )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837 dword_F8B1A8 = 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10838 return pNPCTopics[v1 + 110].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10842 return pNPCTopics[124].pText;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10843 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10844 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10845 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10846 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10847 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10848 return pNPCTopics[122].pText;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
10849 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 //----- (004B2A74) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 char __cdecl sub_4B2A74()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 char *v0; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 char *v1; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 char *v2; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859 const char *v3; // ST1C_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861 unsigned int i; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 NPCData *v6; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 unsigned __int16 v7; // bx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 unsigned int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865 int v9; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 unsigned int v10; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867 int v11; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 int v12; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 char *v13; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 GUIWindow *v14; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 char *v15; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 GUIButton *v16; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 unsigned int v17; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874 int v18; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 int v19; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 int v20; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 int v21; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 int v22; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 unsigned int v23; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 int v24; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 int v25; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882 int v26; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 int v27; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884 int v28; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 char *v29; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 unsigned int v30; // ST20_4@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 int v31; // ST1C_4@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 unsigned int v32; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 char *v33; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 int v34; // esi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 int v35; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 unsigned int v36; // edi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 GUIButton *v37; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 int v38; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 signed int v39; // ecx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 int v40; // edi@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 GUIButton *v41; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 GUIButton *v42; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 const char *v43; // ebx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 int v44; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 unsigned int v45; // ecx@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 unsigned __int16 v46; // ax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 GUIFont *v47; // ebx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 int v48; // esi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 char *v49; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 GUIWindow w; // [sp+Ch] [bp-110h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 GUIWindow v52; // [sp+60h] [bp-BCh]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 GUIWindow a1; // [sp+B4h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 unsigned int v54; // [sp+108h] [bp-14h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 int v55; // [sp+10Ch] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 int v56; // [sp+110h] [bp-Ch]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 char *pInString; // [sp+114h] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 NPCData *v58; // [sp+118h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 memcpy(&a1, pDialogueWindow, sizeof(a1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 if ( array_5913D8[6] == (NPCData *)uNumDialogueNPCPortraits && uHouse_ExitPic )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 v0 = pMapStats->pInfos[uHouse_ExitPic].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 v1 = pMapStats->pInfos[uHouse_ExitPic].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 a1.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 a1.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 a1.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923 a1.DrawText2(pFontCreate, 0, 2u, 0, v1, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 a1.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 a1.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 a1.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 v2 = (&off_4EB080)[4 * uHouse_ExitPic];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[411], v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 v2 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 v4 = pFontCreate->CalcTextHeight(v2, &a1, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 LOBYTE(i) = (unsigned int)a1.DrawText2(pFontCreate, 0, (212 - v4) / 2 + 101, 0, v3, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 return i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 a1.uFrameWidth -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 a1.uFrameZ -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 v58 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 v6 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 v55 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 v7 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 v8 = v6->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10945 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v6->pName, aNPCProfessionNames[v8]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 strcpy(pTmpBuf, v6->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 a1.DrawText2(pFontCreate, 0x1E3u, 0x71u, v7, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 if ( !dword_591080 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 if ( !uDialogueType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10954 v9 = v6->greet;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10955 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10957 v10 = v6->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10958 a1.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 a1.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10960 pInString = (char *)*(&pNPCStats->field_17884 + ((v10 & 3) == 2) + 2 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10961 v11 = pFontArrus->CalcTextHeight(pInString, &a1, 13, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10962 v12 = v11 + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10963 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10964 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 352 - (v11 + 7),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10966 (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10967 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - (v11 + 7));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10968 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10969 v13 = FitTextInAWindow(pInString, pFontArrus, &a1, 0xDu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10970 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10974 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10975 memcpy(&v52, pDialogueWindow, sizeof(v52));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10976 v52.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 v52.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10978 v52.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10979 v56 = v52.field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10980 if ( v52.field_38 < v52.field_38 + v52.field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10982 v15 = (char *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10985 v16 = v52.GetControl(v56);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10986 v17 = v16->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10987 pInString = (char *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10988 if ( (signed int)v17 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 v24 = v17 - 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993 v15 = pGlobalTXT_LocalizationStrings[406];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 v25 = v24 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 if ( !v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999 v15 = pGlobalTXT_LocalizationStrings[407];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002 v26 = v25 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003 if ( !v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 v33 = _4B254D_SkillMasteryTeacher((int)v52.ptr_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 v15 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 v16 = (GUIButton *)pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012 v27 = v26 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013 if ( !v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015 v33 = (char *)sub_4B29F2((int)v52.ptr_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11018 v28 = v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11019 if ( !v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021 v29 = (char *)&pMonsterStats + 88 * word_F8B1A0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 v31 = *(int *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 v32 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 sprintfex(pTmpBuf, &byte_4F0F98, v32, v31, v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026 sprintfex(pTmpBuf2, dword_F8B1A4, pTmpBuf, 100 * (unsigned __int8)v29[8]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027 ptr_F8B1E8 = pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028 v15 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 if ( v28 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 if ( v17 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 v23 = v58->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 v15 = (&dword_721660)[8 * v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 v16->uControlParam = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044 v15 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 v18 = v17 - 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 v19 = v18 - 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054 v23 = v58->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060 v15 = (&dword_721660)[8 * v58->evtb];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 v16->uControlParam = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 v15 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 if ( uDialogueType != 84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 sprintfex(pTmpBuf, format_4E2D80, v55, pItemsTable->pItems[dword_F8B1A8].pUnidentifiedName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 sprintfex(pTmpBuf2, ptr_F8B1E8, pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 ptr_F8B1E8 = pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 v21 = v20 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 v23 = v58->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 v23 = v58->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085 if ( v22 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 v23 = v58->evte;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 v15 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 v15 = pGlobalTXT_LocalizationStrings[122];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097 strcpy(v16->pButtonName, v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 if ( v56 >= v52.field_38 + v52.field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 v54 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11108 v35 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11109 v36 = v14->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11110 v55 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 for ( i = v36 + v14->field_28; (signed int)v36 < (signed int)i; i = pDialogueWindow->field_28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112 + pDialogueWindow->field_38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 v37 = v14->GetControl(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 v34 += v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 v39 = v14->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 v58 = (NPCData *)((174 - v34) / v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 if ( (signed int)v58 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 v58 = (NPCData *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 pInString = (char *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 v40 = (174 - (signed int)v58 * v39 - v34) / 2 - (signed int)v58 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 v56 = v14->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 i = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 if ( (signed int)i < (signed int)(i + v39) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 v41 = v14->GetControl(i);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 v42 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 v43 = v41->pButtonName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 v41->uY = (unsigned int)((char *)v58 + v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 v44 = pFontArrus->CalcTextHeight(v41->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11139 v45 = v42->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 v42->uHeight = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 v40 = v45 + v44 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 v42->uW = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 v46 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 if ( (char *)pDialogueWindow->field_2C_focus_id != pInString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 v46 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 v52.DrawText2(pFontArrus, 0, v45, v46, v43, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 v14 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 ++pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 i = pDialogueWindow->field_28 + pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 if ( v56 >= (signed int)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 i = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 if ( ptr_F8B1E8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159 w.uFrameWidth = 458;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160 w.uFrameZ = 457;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 v47 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 v48 = pFontArrus->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 if ( 352 - v48 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165 v47 = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166 v48 = pFontCreate->CalcTextHeight(ptr_F8B1E8, &w, 13, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 352 - v48,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 pRenderer->DrawTextureIndexed(8u, 347 - v48, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 v49 = FitTextInAWindow(ptr_F8B1E8, v47, &w, 0xDu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 LOBYTE(i) = a1.DrawText(v47, 13, 354 - v48, 0, v49, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 return i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 //----- (004B36CC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 GUIButton *__fastcall sub_4B36CC(int a1, unsigned int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 return pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 0x1E0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 30 * a1 + 146,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 0x8Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 0x1Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 0x195u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 //----- (004B3703) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 int __thiscall sub_4B3703(void *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 char *v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 signed int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 int v6; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 int v7; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 int v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 int v9; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 signed int v10; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 signed int v11; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 signed int v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 unsigned int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217 int v14; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218 int v15; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219 int v16; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11220 int v17; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11221 int v18; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11222 signed int v19; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11223 char *v20; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224 int v21; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225 int v22; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 int v23; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 int v24; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 int v25; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229 int v26; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230 int v27; // ecx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231 int *v28; // esi@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232 unsigned int v29; // edx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233 char *v30; // ecx@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234 int v31; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235 int result; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236 int v33; // [sp-4h] [bp-2Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237 int v34; // [sp-4h] [bp-2Ch]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 int v35[5]; // [sp+Ch] [bp-1Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 int a2; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 int v37; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244 v3 = (char *)_this - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245 a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 dword_F8B1DC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253 v19 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 v20 = (char *)ptr_507BC0->ptr_1C + 4 * (unsigned int)ptr_507BC0->ptr_1C + v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 v21 = word_4F063E[(signed int)v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 v21 = word_4F03FE[(signed int)v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 v22 = v21 - 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 v23 = v22 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265 if ( v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 v24 = v23 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268 if ( v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 v25 = v24 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274 if ( v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 v27 = v26 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 if ( v27 != v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 v34 = 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11283 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 v34 = 42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 v34 = 41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11293 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11295 v34 = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 v34 = 39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 v34 = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11308 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11310 v34 = 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11312 v37 = sub_4BE571(v34, v35, v37, 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 v2 = dword_F8B1DC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11318 while ( v19 <= 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11319 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11320 if ( v1 >= v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11321 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11324 v5 = (int)(v3 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 v13 = v11 + 2 * (unsigned int)ptr_507BC0->ptr_1C - 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 v14 = v12 + 4 * v13 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11339 v15 = word_4F06D8[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11341 v15 = word_4F0498[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 v16 = v15 - 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 v17 = v16 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 v18 = v17 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 if ( v18 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 v33 = 44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 v33 = 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 v33 = 46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 v33 = 45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 v37 = sub_4BE571(v33, v35, v37, 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 v2 = dword_F8B1DC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 while ( v12 <= 4 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 while ( v11 < 2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11378 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11379 if ( v10 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 goto LABEL_53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 v6 = v5 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 v7 = v6 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 v8 = v7 - 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 v9 = v8 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 if ( v9 == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 v37 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398 v35[0] = 69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 v35[1] = 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 v37 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 v35[0] = 67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406 v35[1] = 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 v35[2] = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412 v37 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 v35[0] = 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 v35[1] = 65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415 v35[2] = 62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11420 v37 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11421 v35[0] = 71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 v35[1] = 68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427 v37 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428 v35[0] = 57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11429 v35[1] = 59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 LABEL_53:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11432 if ( v37 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 v28 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437 v29 = *v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11438 if ( *v28 <= 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11439 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440 if ( (signed int)v29 <= 66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 if ( v29 == 66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11444 v30 = pSkillNames[30];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11445 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 if ( v29 == 57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 v30 = pSkillNames[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 if ( v29 == 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 v30 = pSkillNames[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 if ( v29 == 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 v30 = pSkillNames[24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 if ( v29 == 62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 v30 = pSkillNames[26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11467 if ( v29 == 65 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11469 v30 = pSkillNames[29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472 goto LABEL_100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11474 switch ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11476 case 0x43u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 v30 = pSkillNames[31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 case 0x44u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480 v30 = pSkillNames[32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 case 0x45u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11483 v30 = pSkillNames[33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11484 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 case 0x46u:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11486 v30 = pSkillNames[34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 if ( v29 != 71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 goto LABEL_100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 v30 = pSkillNames[35];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11494 LABEL_106:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11495 pShopOptions[v2] = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11496 v31 = a2++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 dword_F8B1DC = v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 sub_4B36CC(v31, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11499 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11500 if ( a2 >= v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 goto LABEL_107;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 v2 = dword_F8B1DC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 if ( *v28 == 47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11506 v30 = pSkillNames[11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11507 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 if ( (signed int)v29 > 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 if ( v29 == 41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 v30 = pSkillNames[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11514 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11516 if ( v29 == 42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 v30 = pSkillNames[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 if ( v29 == 44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11523 v30 = pSkillNames[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 if ( v29 == 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 v30 = pSkillNames[9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 if ( v29 == 46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 v30 = pSkillNames[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11537 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11539 if ( v29 == 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541 v30 = pSkillNames[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 if ( v29 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 v30 = pSkillNames[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11547 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 if ( v29 == 36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 v30 = pSkillNames[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 if ( v29 == 37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556 v30 = pSkillNames[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11559 if ( v29 == 38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11561 v30 = pSkillNames[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11562 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11564 if ( v29 == 39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11566 v30 = pSkillNames[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11567 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 LABEL_100:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11571 v30 = pGlobalTXT_LocalizationStrings[127];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11572 goto LABEL_106;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11574 LABEL_107:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 pDialogueWindow->_41D08F(a2, 1, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 result = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 dword_F8B1E0 = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 //----- (004B3A72) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 int __thiscall sub_4B3A72(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 if ( a1 == 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 sub_4B36CC(0, 0x66u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 v1 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 sub_4B36CC(1, 0x67u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 if ( pParty->HasItem(0x28Bu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11596 v1 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 sub_4B36CC(2, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 pDialogueWindow->_41D08F(v1, 1, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11601 result = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 dword_F8B1E0 = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 // F8B1E0: using guessed type int dword_F8B1E0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 //----- (004B3AD4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 int __fastcall sub_4B3AD4(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 int result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611 int v2; // [sp-10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11612 int v3; // [sp-Ch] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613 int v4; // [sp-8h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 int v5; // [sp-4h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 if ( a1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11618 if ( a1 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 sub_4B36CC(0, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11621 sub_4B36CC(1, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 sub_4B36CC(2, 5u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11623 v5 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11624 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11625 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 v2 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11627 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 if ( a1 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 sub_4B36CC(0, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11632 sub_4B36CC(1, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 v5 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 v2 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11638 pDialogueWindow->_41D08F(v2, v3, v4, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 result = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644 dword_F8B1E0 = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647 // F8B1E0: using guessed type int dword_F8B1E0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11649 //----- (004B3B42) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11650 int __fastcall sub_4B3B42(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 int v1; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653 int v2; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 int v3; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11655 signed int v4; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11656 signed int v5; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11657 unsigned int v6; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11658 int v7; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11659 int result; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11660 int v9; // [sp-10h] [bp-14h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11661 int v10; // [sp-Ch] [bp-10h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11662 int v11; // [sp-8h] [bp-Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11663 unsigned int v12; // [sp-4h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 unsigned int v13; // [sp-4h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665 unsigned int v14; // [sp-4h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 unsigned int v15; // [sp-4h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11667 unsigned int v16; // [sp-4h] [bp-8h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 int v17; // [sp-4h] [bp-8h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11670 if ( a1 > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672 if ( a1 > 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11674 if ( a1 == 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11676 sub_4B36CC(0, 0xAu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 sub_4B36CC(1, 0xBu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678 v14 = 96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11680 sub_4B36CC(2, v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11681 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 v9 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 if ( a1 <= 26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 if ( a1 > 28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11691 if ( a1 != 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11693 sub_4B36CC(0, 0x11u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 v16 = 96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11695 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 sub_4B36CC(0, 0x69u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 sub_4B36CC(1, 0x6Au);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699 sub_4B36CC(2, 0x6Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 v12 = 108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 if ( a1 == 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11706 sub_4B36CC(0, 7u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707 v16 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11710 v1 = a1 - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11711 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714 sub_4B36CC(1, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11715 sub_4B36CC(2, 0x31u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11716 sub_4B36CC(3, 0x32u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717 sub_4B36CC(4, 0x33u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11719 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11721 v9 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724 v2 = v1 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11727 v3 = v2 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 if ( v3 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 sub_4B36CC(0, 0xFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 sub_4B36CC(1, 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734 v4 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 sub_4B36CC(2, 0x60u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736 v5 = (signed int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 if ( v5 < 108 || v5 > 120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11738 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11739 v4 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11740 v6 = 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741 v7 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11745 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 sub_4B36CC(0, 0x63u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747 if ( !pParty->uFine )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11750 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 v9 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 pDialogueWindow->_41D08F(v9, v10, v11, v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11758 v4 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11759 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11760 v6 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11762 sub_4B36CC(v7, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11763 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 sub_4B36CC(1, 0x34u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11767 sub_4B36CC(2, 0x35u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 v12 = 54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11771 sub_4B36CC(3, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11774 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11775 v9 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11776 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778 if ( a1 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11780 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 v16 = 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 sub_4B36CC(1, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11784 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11786 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 v9 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 switch ( a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 sub_4B36CC(0, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 sub_4B36CC(1, 0x5Fu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798 sub_4B36CC(2, 0x5Eu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799 v12 = 96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 v13 = 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 v13 = 49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811 v13 = 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11812 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11813 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11814 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 v13 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11817 sub_4B36CC(1, v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818 v14 = 72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11819 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11822 v15 = 52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11823 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11824 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826 v15 = 53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11827 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11828 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11829 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 v15 = 54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 sub_4B36CC(1, v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11833 v14 = 61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11836 sub_4B36CC(0, 0x12u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11837 v16 = 55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11838 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11840 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 result = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11844 dword_F8B1E0 = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11845 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11847 // F8B1E0: using guessed type int dword_F8B1E0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11848
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11849 //----- (004B3E1E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11850 void __cdecl sub_4B3E1E()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11852 NPCData *v0; // ST40_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11853 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11854 GUIWindow *v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11855
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11856 v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11857 v1 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11858 pDialogueWindow->eWindowType = WINDOW_MainMenu;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11859 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11860 v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_A, 1, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11861 pDialogueWindow = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11862 if ( *(&pNPCStats->field_13A5C + 5 * v0->uProfession) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11864 v2->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 0x1E0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 0xA0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11867 0x8Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11868 0x1Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11869 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11871 0x88u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11872 0x4Du,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11873 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11874 pGlobalTXT_LocalizationStrings[407],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11878 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11879 0x1E0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11880 30 * v1 + 160,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11881 0x8Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 0x1Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11883 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11884 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11885 0x88u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11886 0x4Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11887 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11888 pGlobalTXT_LocalizationStrings[406],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11889 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11890 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11893 //----- (004B3EF0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11894 void __fastcall sub_4B3EF0(int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11896 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11897
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11898 v1 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11899 uDialogueType = 81;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11900 ptr_F8B1E8 = (char *)pNPCTopics[a4 + 99].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11901 sub_4B29F2(a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11902 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11903 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, v1, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11904 ptr_5076F4 = pDialogueWindow->CreateButton(
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11905 0x1D7,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11906 0x1BD,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11907 0xA9,
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11908 0x23,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11909 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11910 0,
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11911 0x71,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11912 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11913 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11914 pGlobalTXT_LocalizationStrings[34],
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11915 (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11916 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11919 0x1E0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11920 0xA0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 0x8Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 0x1Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11924 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11925 0xAFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11926 0x52u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11927 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11928 pGlobalTXT_LocalizationStrings[122],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11929 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 pDialogueWindow->_41D08F(1, 1, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11931 dword_F8B19C = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11933 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11934
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11935 //----- (004B3FE5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11936 void __fastcall sub_4B3FE5(int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11938 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11939 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11940
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11941 v1 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11942 uDialogueType = 78;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11943 ptr_F8B1E8 = (char *)pNPCTopics[a4 + 168].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11944 _4B254D_SkillMasteryTeacher(a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11945 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11946 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, v1, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11947 v2 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11950 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11951 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11953 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11954 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11955 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11956 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11957 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11958 pGlobalTXT_LocalizationStrings[34],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11959 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11960 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11961 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 if ( dword_F8B1A8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11963 v2 = pGlobalTXT_LocalizationStrings[535];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11964 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Fu, 0, v2, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11965 pDialogueWindow->_41D08F(1, 1, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11966 dword_F8B19C = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11968 // F8B19C: using guessed type int dword_F8B19C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11969 // F8B1A8: using guessed type int dword_F8B1A8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11970
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11971 //----- (004B40E6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 void __cdecl sub_4B40E6()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11974 signed int v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11975 NPCData *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11976
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11977 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11978 v1 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11979 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
11980 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11981 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11982 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11983 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11984 0xA9u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 0x23u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11986 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11989 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991 pGlobalTXT_LocalizationStrings[34],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11992 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 if ( *(&pNPCStats->field_13A5C + 5 * v1->uProfession) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 0x1E0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 0xA0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 0x8Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 0x1Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004 0xAFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 0x4Du,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 pGlobalTXT_LocalizationStrings[407],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012 0x1E0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 30 * v0 + 160,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014 0x8Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 0x1Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12016 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018 0xAFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019 0x4Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021 pGlobalTXT_LocalizationStrings[406],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023 pDialogueWindow->_41D08F(v0 + 1, 1, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024 dword_F8B19C = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12028 //----- (004B4224) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12029 GUIButton *_4B4224_UpdateNPCTopics(int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12031 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032 GUIButton *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033 int i; // ebp@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034 signed int v4; // ebp@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035 void *v5; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036 bool v6; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037 void *v7; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038 bool v8; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039 void *v9; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040 bool v10; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 void *v11; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 bool v12; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 void *v13; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 bool v14; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 void *v15; // ecx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 bool v16; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 NPCData *v17; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12049 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12050 array_5913D8[6] = (NPCData *)(_this + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12051 if ( _this + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 pDialogueWindow->Release();
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12054 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 sprintfex(byte_591098, pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[uHouse_ExitPic].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 0x236u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059 0x4Bu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060 0x21u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12061 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12062 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12063 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065 0x4Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 pGlobalTXT_LocalizationStrings[34],// "Cancel"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12069 ptr_5076FC = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070 486u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12071 445u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12072 75u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12073 33u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 0xBFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 0x59u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 byte_591098,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 _4E5E50_transui_x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084 _4E5EE0_transui_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 63u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 73u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089 0xBFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091 0x20u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 byte_591098,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 result = pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, byte_591098, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 v17 = array_5913D8[_this + 1 - ((dword_591080 != 0) + 1)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 if ( dword_F8B19C == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12105 for ( i = 0; i < uNumDialogueNPCPortraits; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 GUIButton::_41D0D8((GUIButton *)array_5913D8[i + 7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 v4 = 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12109 pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 ptr_5076F4 = pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 471u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 445u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113 169u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12114 35u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12115 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12116 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12117 0x71u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12118 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12119 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12120 pGlobalTXT_LocalizationStrings[74],// "End Conversation"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12121 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12122 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12123 pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12124 if ( array_5913D8[6] == (NPCData *)1 && dword_591080 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12126 result = (GUIButton *)sub_4B3B42(dword_F8B198);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12128 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12130 if ( v17->joins )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12132 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12133 pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, 0xAFu, 0xDu, 0, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12135 v5 = (void *)v17->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12136 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12138 if ( v1 < 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12140 v6 = sub_4466C4(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12141 if ( v6 == 1 || v6 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12142 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12143 480u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12144 30 * v1++ + 160,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12145 140u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12146 30u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12147 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12148 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12149 0xAFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12150 0x13u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12151 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12152 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12153 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12156 v7 = (void *)v17->evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12157 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12159 if ( v1 < 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12161 v8 = sub_4466C4(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12162 if ( v8 == 1 || v8 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12163 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12164 480u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12165 30 * v1++ + 160,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12166 140u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12167 30u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12168 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12169 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12170 0xAFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12171 0x14u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12172 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12173 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12174 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12177 v9 = (void *)v17->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12178 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12180 if ( v1 < 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12182 v10 = sub_4466C4(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12183 if ( v10 == 1 || v10 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12184 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12185 480u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12186 30 * v1++ + 160,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12187 140u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12188 30u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12189 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12190 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12191 0xAFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12192 0x15u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12193 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12194 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12195 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 v11 = (void *)v17->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12199 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12201 if ( v1 < 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12203 v12 = sub_4466C4(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12204 if ( v12 == 1 || v12 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12205 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12206 0x1E0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12207 30 * v1++ + 160,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12208 0x8Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12209 0x1Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12210 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12211 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12212 0xAFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12213 0x16u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12215 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12216 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12219 v13 = (void *)v17->evte;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12220 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12222 if ( v1 < 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 v14 = sub_4466C4(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12225 if ( v14 == 1 || v14 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12226 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 0x1E0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 30 * v1++ + 160,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 0x8Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12230 0x1Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12232 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233 0xAFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12234 0x17u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12235 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12236 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12240 v15 = (void *)v17->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243 if ( v1 < 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12245 v16 = sub_4466C4(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12246 if ( v16 == 1 || v16 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12247 pDialogueWindow->CreateButton(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12248 0x1E0u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 30 * v1++ + 160,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 0x8Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 0x1Eu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12254 0xAFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12255 0x18u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12256 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12257 nullstring,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12258 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12261 pDialogueWindow->_41D08F(v1, 1, 0, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 result = (GUIButton *)pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 dword_F8B1E0 = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12266 dword_F8B19C = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12272
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 //----- (004B46A5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 char __fastcall sub_4B46A5(const char *Str, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12276 const char *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12278 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 v2 = Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 v3 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12282 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 v4 = pFontLucida->AlignText_Center(0x1C2u, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 return pGUIWindow0->DrawText(pFontLucida, v4 + 11, 357, v3, v2, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12286
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 //----- (004B46F8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12288 int __fastcall sub_4B46F8(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291 int i; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294 for ( i = 0; i < a1; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295 v1 += i + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 return 1000 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299 //----- (004B4710) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300 int __cdecl ui_training()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12302 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303 int color2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 unsigned int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306 signed int v4; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 int v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12308 unsigned int v6; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309 void *v7; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 int v8; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311 double v9; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12312 signed int v10; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314 int result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315 GUIWindow *v13; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12316 signed int v14; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317 unsigned int v15; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12318 int v16; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 unsigned int v17; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320 int v18; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321 int v19; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12322 GUIButton *v20; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323 GUIButton *v21; // esi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324 int v22; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 const char *v23; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12326 int v24; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 unsigned int v25; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 int v26; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329 unsigned __int16 v27; // ax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12330 int v28; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12331 unsigned __int16 v29; // ST14_2@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12332 int v30; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12333 const char *v31; // ST18_4@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12334 unsigned __int16 v32; // ST14_2@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12335 int v33; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336 int v34; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12337 unsigned int v35; // edi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12338 unsigned int v36; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 int v37; // ecx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12340 char *v38; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341 int *v39; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 unsigned int v40; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343 void *v41; // ecx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 unsigned int v42; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 GUIWindow *v43; // ecx@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 int v44; // edx@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 char **v45; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 int v46; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 int v47; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350 int v48; // edx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351 int v49; // ebx@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352 unsigned __int8 v50; // sf@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353 char **v51; // edi@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 GUIButton *v52; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355 GUIButton *v53; // esi@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12356 int v54; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12357 unsigned int v55; // ecx@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12358 int v56; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12359 unsigned __int16 v57; // ax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360 unsigned __int16 v58; // [sp-Ch] [bp-90h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 const char *v59; // [sp-Ch] [bp-90h]@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12362 char *v60; // [sp-8h] [bp-8Ch]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 char *v61; // [sp-8h] [bp-8Ch]@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 unsigned int v62; // [sp-4h] [bp-88h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365 int v63; // [sp-4h] [bp-88h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12366 char *v64; // [sp-4h] [bp-88h]@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12367 GUIWindow v65; // [sp+Ch] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12368 __int64 v66; // [sp+60h] [bp-24h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12369 unsigned int white; // [sp+68h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370 int v68; // [sp+6Ch] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 int v69; // [sp+70h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 unsigned int i; // [sp+74h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 int v71; // [sp+78h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 int v72; // [sp+7Ch] [bp-8h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 int v73; // [sp+80h] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12378 memcpy(&v65, ptr_507BC0, sizeof(v65));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379 v65.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 v65.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 v65.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12384 v2 = v0->uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385 v71 = color2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12388 for ( i = v2; v4 < (signed int)v2; ++v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12389 v3 += v4 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12390 v5 = 1000 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391 v6 = HIDWORD(v0->uExperience);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 v7 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12393 v68 = (unsigned __int16)word_4F0866[(signed int)v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 v66 = 1000 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 if ( (signed __int64)__PAIR__(v6, LODWORD(v0->uExperience)) >= v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12397 v8 = v0->uClass % 4 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 if ( v8 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 v8 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12400 v9 = (double)(signed int)i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 v69 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 //v10 = (signed __int64)(v9 * p2DEvents_minus1__20[13 * (signed int)v7] * (double)v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12404 v10 = (signed __int64)(v9 * p2DEvents[(signed int)v7 - 1].fPriceMultiplier * (double)v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 v11 = v10 * (100 - v0->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12406 if ( v11 < v10 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12407 v11 = v10 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408 i = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 if ( dword_F8B19C != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 result = dword_F8B19C - 96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418 if ( dword_F8B19C == 96 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12421 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12423 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 v13 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425 //v14 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (unsigned int)ptr_507BC0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 v14 = (signed __int64)(p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 v73 = v14 * (100 - v0->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 if ( v73 < v14 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12429 v73 = v14 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12430 v15 = v13->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12431 v16 = v13->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433 if ( (signed int)v15 >= (signed int)(v15 + v16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 v17 = v13->GetControl(v15)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 if ( byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v17] && !v0->pActiveSkills[v17] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12440 v18 = pFontArrus->CalcTextHeight(pSkillNames[v17], &v65, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 i += v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 ++v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 while ( (signed int)v15 < v13->field_28 + v13->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 if ( v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v73);// "Skill Cost: %lu"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 v65.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 v73 = (signed int)(149 - i) / v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 if ( v73 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 v73 = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 result = v13->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 v19 = (signed int)(149 - v72 * v73 - i) / 2 - v73 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 i = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 v68 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 if ( result < result + v13->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 v72 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 v20 = v13->GetControl(i);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 v22 = v20->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 if ( !byte_4ED970_skill_learn_ability_by_class_table[v0->uClass][v22] || v0->pActiveSkills[v22] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12468 v21->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 v21->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12470 v21->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12472 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 v23 = pSkillNames[v22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 v21->uY = v73 + v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476 HIDWORD(v66) = (int)v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12477 v24 = pFontArrus->CalcTextHeight(v23, &v65, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12478 v25 = v21->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 v21->uHeight = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12480 v26 = v25 + v24 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12481 v21->uW = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12482 v68 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 v27 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12484 if ( pDialogueWindow->field_2C_focus_id != v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12485 v27 = white;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 v65.DrawText2(pFontArrus, 0, v25, v27, (char *)HIDWORD(v66), 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 v28 = v13->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490 result = v13->field_28 + v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491 ++v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493 while ( (signed int)i < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v0->pName, pClassNames[v0->uClass]);//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500 // "Seek knowledge elsewhere %s the %s"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 v29 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 v30 = pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 result = (int)v65.DrawText2(pFontArrus, 0, (174 - v30) / 2 + 138, v29, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12513 v31 = pNPCTopics[122].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 v32 = v71;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
12515 v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12516 v65.DrawText2(pFontArrus, 0, (212 - v33) / 2 + 101, v32, v31, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517 result = (int)pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 pDialogueWindow->field_28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 v34 = v0->uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 if ( v34 < v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 if ( (signed __int64)v0->uExperience >= v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 if ( pParty->uNumGold >= i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12528 Party::TakeGold(i);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12530 ++v0->uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 v0->uSkillPoints += v0->uLevel / 10 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 v0->sHealth = v0->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 v0->sMana = v0->GetMaxMana();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 v38 = byte_F8B148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12538 if ( *(int *)v38 > v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12539 v37 = *(int *)v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12540 v38 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12542 while ( (signed int)v38 < (signed int)word_F8B158 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12543 v39 = &dword_F8B144 + uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544 ++*v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 if ( *v39 > v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12547 v40 = sub_494820(pParty->uCurrentHour);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12548 v41 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12549 v42 = 60 * (v40 + 4) - pParty->uCurrentMinute;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12550 if ( v41 == (void *)94 || v41 == (void *)95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12551 v42 += 720;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12552 RestAndHeal((signed int)(v42 + 10080));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12553 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 pOutdoor->SetFog();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 v0->PlaySound(87, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[430], v0->pName, v0->uLevel, v0->uLevel / 10 + 5);//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 // "%s is now Level %lu and has earned %lu Skill Points!"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 ShowStatusBarString(pTmpBuf, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 v63 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[538], v5 - LODWORD(v0->uExperience), v34 + 1);//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 // "You need %d more experience to train to level %d"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 v62 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 v60 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 v58 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588 sprintfex(pTmpBuf, "%s\n \n%s", pGlobalTXT_LocalizationStrings[536], pGlobalTXT_LocalizationStrings[529]);//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 // ""With your skills, you should be working here as a teacher.""
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 // ""Sorry, but we are unable to train you.""
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 v62 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 v60 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 v58 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 v36 = (212 - pFontArrus->CalcTextHeight(pTmpBuf, &v65, 0, 0)) / 2 + 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 v65.DrawText2(pFontArrus, v35, v36, v58, v60, v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 v63 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604 v43 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 pShopOptions[0] = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 pShopOptions[1] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 v44 = pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 v73 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610 if ( v73 < v73 + v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 v45 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 if ( v43->GetControl(v73)->uControlParam == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617 v46 = v0->uLevel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 if ( v46 < v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620 if ( (signed __int64)v0->uExperience < v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 v64 = (char *)(v46 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 v61 = (char *)(v5 - LODWORD(v0->uExperience));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 v59 = pGlobalTXT_LocalizationStrings[538];// "You need %d more experience to train to level %d"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 v64 = (char *)i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 v61 = (char *)(v46 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630 v59 = pGlobalTXT_LocalizationStrings[537];// "Train to level %d for %d gold"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12635 v64 = pGlobalTXT_LocalizationStrings[529];// ""Sorry, but we are unable to train you.""
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12636 v61 = pGlobalTXT_LocalizationStrings[536];// ""With your skills, you should be working here as a teacher.""
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637 v59 = "%s\n \n%s";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 sprintfex(*v45, v59, v61, v64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641 v47 = pFontArrus->CalcTextHeight(*v45, &v65, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642 v43 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 v72 += v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 ++v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12645 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 while ( v73 < pDialogueWindow->field_28 + pDialogueWindow->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 HIDWORD(v66) = (174 - v72) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 result = v43->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651 v48 = result + v43->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652 v49 = (2 * (87 - (174 - v72) / 2) - v72) / 2 - (174 - v72) / 2 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653 v50 = -v43->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654 v73 = v43->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 if ( v50 ^ __OFSUB__(result, v48) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657 i = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 v51 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661 v52 = v43->GetControl(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 v53 = v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 v52->uY = HIDWORD(v66) + v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 v54 = pFontArrus->CalcTextHeight(*v51, &v65, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 v55 = v53->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 v53->uHeight = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667 v56 = v54 + v55 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 v53->uW = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669 v49 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 v57 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671 if ( pDialogueWindow->field_2C_focus_id != i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 v57 = white;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 v65.DrawText2(pFontArrus, 0, v55, v57, *v51, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 v43 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 ++v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 result = pDialogueWindow->field_28 + pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 while ( v73 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 //----- (004B4FCF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 int __cdecl ui_shop_teachers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 Player *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 int result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 signed int v2; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 unsigned int v3; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 char *v4; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 char *v5; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 unsigned int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705 int v7; // ST08_4@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 int v8; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 unsigned __int8 v9; // dl@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 char *v10; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 signed int v11; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 int v12; // ST08_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 int v13; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712 int v14; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 char **v15; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 int v16; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 GUIWindow *v17; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 int v18; // edx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 int v19; // edi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718 unsigned __int8 v20; // sf@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 GUIButton *v21; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 const char **v22; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12721 int v23; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 unsigned int v24; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 const char **v25; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 unsigned __int16 v26; // ax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 signed int v27; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 int v28; // ST08_4@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12727 int v29; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 char *v30; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 GUIWindow *v31; // edi@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 void *v32; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 signed int v33; // esi@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 unsigned int v34; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733 int v35; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 unsigned int v36; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735 int v37; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 int v38; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 GUIButton *v39; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 GUIButton *v40; // esi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 int v41; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 char *v42; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 int v43; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12742 unsigned int v44; // ecx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 int v45; // edx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12744 int v46; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 unsigned __int16 v47; // ax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12746 int v48; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 signed int v49; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12748 Texture *v50; // ecx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12749 unsigned int v51; // edi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12750 unsigned int v52; // esi@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751 int v53; // edx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 Texture *v54; // ecx@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 unsigned int v55; // edi@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 unsigned int v56; // esi@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 int v57; // edx@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 Texture *v58; // ecx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 unsigned int v59; // edi@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 unsigned int v60; // esi@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 int v61; // edx@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 Texture *v62; // ecx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 unsigned int v63; // edi@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 unsigned int v64; // esi@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 int v65; // edx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 signed int v66; // ecx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 SHORT v67; // di@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 bool v68; // eax@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 const char *v69; // ecx@119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 POINT *v70; // esi@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 int v71; // ecx@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 int v72; // eax@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771 int v73; // ecx@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 ItemGen *v74; // esi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 int v75; // eax@130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 int v76; // esi@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775 char **v77; // edi@131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 int v78; // eax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 GUIWindow *v79; // ecx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 int v80; // edx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 int v81; // edi@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 GUIButton *v82; // esi@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781 const char **v83; // eax@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 int v84; // eax@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 unsigned int v85; // ecx@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 int v86; // edx@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 unsigned __int16 v87; // ax@135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 GUIWindow *v88; // [sp-18h] [bp-110h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787 int v89; // [sp-14h] [bp-10Ch]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 ItemGen *v90; // [sp-10h] [bp-108h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 int v91; // [sp-10h] [bp-108h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 unsigned __int16 v92; // [sp-Ch] [bp-104h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 void *v93; // [sp-Ch] [bp-104h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 int v94; // [sp-8h] [bp-100h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 char *v95; // [sp-8h] [bp-100h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 __int64 *v96; // [sp-4h] [bp-FCh]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 unsigned int v97; // [sp-4h] [bp-FCh]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 POINT v98; // [sp+Ch] [bp-ECh]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 POINT v99; // [sp+14h] [bp-E4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 POINT v100; // [sp+1Ch] [bp-DCh]@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 POINT v101; // [sp+24h] [bp-D4h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800 POINT v102; // [sp+2Ch] [bp-CCh]@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 POINT v103; // [sp+34h] [bp-C4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 POINT v104; // [sp+3Ch] [bp-BCh]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 POINT v105; // [sp+44h] [bp-B4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 POINT v106; // [sp+4Ch] [bp-ACh]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 POINT v107; // [sp+54h] [bp-A4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 POINT v108; // [sp+5Ch] [bp-9Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 POINT a2; // [sp+64h] [bp-94h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 POINT v110; // [sp+6Ch] [bp-8Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 POINT v111; // [sp+74h] [bp-84h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 GUIWindow v112; // [sp+7Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 char *Str; // [sp+D0h] [bp-28h]@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 int v114; // [sp+D4h] [bp-24h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 unsigned int color2; // [sp+D8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 unsigned int white; // [sp+DCh] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 __int32 v117; // [sp+E0h] [bp-18h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 int v118; // [sp+E4h] [bp-14h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 const char **v119; // [sp+E8h] [bp-10h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 Player *_this; // [sp+ECh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 unsigned __int8 uPlayerID; // [sp+F3h] [bp-5h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 int v122; // [sp+F4h] [bp-4h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12821
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 v0 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12823 _this = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 memcpy(&v112, ptr_507BC0, sizeof(v112));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12825 v112.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 v112.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 v112.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828 white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12829 color2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 if ( dword_F8B19C > 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832 if ( dword_F8B19C == 94 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 pShopOptions[0] = pGlobalTXT_LocalizationStrings[200];// "Sell"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 pShopOptions[1] = pGlobalTXT_LocalizationStrings[113];// "Identify"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 pShopOptions[2] = pGlobalTXT_LocalizationStrings[179];// "Repair"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 v76 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 v77 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 v78 = pFontArrus->CalcTextHeight(*v77, &v112, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12844 ++v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845 v76 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847 while ( (signed int)v77 < (signed int)&pShopOptions[3] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12848 v79 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 _this = (Player *)((174 - v76) / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 result = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 v80 = result + pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 v81 = (3 * (58 - (signed int)_this) - v76) / 2 - (174 - v76) / 3 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 v20 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 v118 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 if ( v20 ^ __OFSUB__(result, v80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 v122 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12858 v119 = (const char **)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 v82 = v79->GetControl(v118);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 v83 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863 v82->uY = (unsigned int)((char *)_this + v81);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 v84 = pFontArrus->CalcTextHeight(*v83, &v112, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 v85 = v82->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 v86 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 v82->uHeight = v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12868 v81 = v84 + v85 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 v82->uW = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 v87 = color2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 if ( pDialogueWindow->field_2C_focus_id != v86 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 v87 = white;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 v112.DrawText2(pFontArrus, 0, v85, v87, *v119, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 v79 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 ++v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 ++v118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 result = pDialogueWindow->field_28 + pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12880 while ( v118 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12882 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12884 if ( dword_F8B19C != 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12886 result = dword_F8B19C - 96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12887 if ( dword_F8B19C == 96 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12889 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12890 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12892 v31 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12893 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12894 v32 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12895 v118 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12896 //v33 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v32] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12897 v33 = (signed __int64)(p2DEvents[(signed int)v32 - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12898 v119 = (const char **)(v33 * (100 - _this->GetMerchant()) / 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12899 if ( (signed int)v119 < v33 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12900 v119 = (const char **)(v33 / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12901 v34 = v31->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12902 v35 = v34 + v31->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12903 v122 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904 if ( (signed int)v34 >= v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905 goto LABEL_140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12906 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12908 v36 = v31->GetControl(v34)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12909 if ( byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v36] && !_this->pActiveSkills[v36] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12911 v37 = pFontArrus->CalcTextHeight(pSkillNames[v36], &v112, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12912 v118 += v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12913 ++v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12915 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12917 while ( (signed int)v34 < v31->field_28 + v31->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12918 if ( !v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12920 LABEL_140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12921 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], _this->pName, pClassNames[_this->uClass]);//
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12922 // "Seek knowledge elsewhere %s the %s"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12923 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12924 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);// "I can offer you nothing further."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12925 v30 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12926 v97 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12927 v95 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12928 v92 = color2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12929 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12931 v88 = &v112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932 goto LABEL_61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v119);// "Skill Cost: %lu"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 v112.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 v119 = (const char **)((149 - v118) / v122);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937 if ( (149 - v118) / v122 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 v119 = (const char **)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939 result = v31->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 v38 = (149 - v122 * (signed int)v119 - v118) / 2 - (signed int)v119 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941 v118 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 v114 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 if ( result < result + v31->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945 v122 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 v39 = v31->GetControl(v118);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 v40 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 v41 = v39->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 if ( !byte_4ED970_skill_learn_ability_by_class_table[_this->uClass][v41] || _this->pActiveSkills[v41] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 v40->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 v40->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 v40->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 v42 = pSkillNames[v41];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960 v40->uY = (unsigned int)((char *)v119 + v114);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 Str = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962 v43 = pFontArrus->CalcTextHeight(v42, &v112, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 v44 = v40->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964 v45 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 v40->uHeight = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 v46 = v44 + v43 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967 v40->uW = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968 v114 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969 v47 = color2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12970 if ( pDialogueWindow->field_2C_focus_id != v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971 v47 = white;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12972 v112.DrawText2(pFontArrus, 0, v44, v47, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974 v48 = v31->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 ++v118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 result = v31->field_28 + v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12977 ++v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979 while ( v118 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12983 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12986 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 if ( dword_F8B19C == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12990 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 sub_4B46A5(pGlobalTXT_LocalizationStrings[198], 0);// "Select the Item to Repair"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12993 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 if ( !result
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12995 || (v27 = pMouse->GetCursorPos(&v110)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12996 v117 = (v27 >> 5) + 14 * ((pMouse->GetCursorPos(&v108)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997 result = (int)pMouse->GetCursorPos(&v106),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998 *(int *)result <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999 || (result = (int)pMouse->GetCursorPos(&v104), *(int *)result >= 462)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13000 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 || (result *= 9, !(_this->field_1F5[4 * result + 15] & 2)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004 v94 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 v93 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13006 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007 v28 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008 uPlayerID = uActiveCharacter - 1;
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13009 v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 v9 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 v10 = (char *)pMerchantsRepairPhrases[v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 pShopOptions[0] = pGlobalTXT_LocalizationStrings[134];// "Buy Standard"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 pShopOptions[1] = pGlobalTXT_LocalizationStrings[152];// "Buy Special"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 pShopOptions[2] = pGlobalTXT_LocalizationStrings[159];// "Display Inventory"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023 pShopOptions[3] = pGlobalTXT_LocalizationStrings[160];// "Learn Skills"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 v15 = pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027 v16 = pFontArrus->CalcTextHeight(*v15, &v112, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 v14 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 while ( (signed int)v15 < (signed int)&unk_F8B1C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032 v17 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13033 v114 = (174 - v14) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13034 result = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13035 v18 = result + pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13036 v19 = (174 - 4 * (174 - v14) / 4 - v14) / 2 - (174 - v14) / 4 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 v20 = -pDialogueWindow->field_28 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 v122 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 if ( v20 ^ __OFSUB__(result, v18) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13041 v119 = (const char **)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13042 _this = (Player *)pShopOptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13045 v21 = v17->GetControl(v122);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 v22 = (const char **)_this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13047 v21->uY = v114 + v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 v23 = pFontArrus->CalcTextHeight(*v22, &v112, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 v24 = v21->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13050 v25 = v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13051 v21->uHeight = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13052 v19 = v24 + v23 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13053 v21->uW = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054 v26 = color2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13055 if ( (const char **)pDialogueWindow->field_2C_focus_id != v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13056 v26 = white;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13057 v112.DrawText2(pFontArrus, 0, v24, v26, (const char *)LODWORD(_this->pConditions[0]), 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13058 v17 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13059 v119 = (const char **)((char *)v119 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060 _this = (Player *)((char *)_this + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 ++v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13062 result = pDialogueWindow->field_28 + pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064 while ( v122 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13067 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 if ( dword_F8B19C != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13073 result = dword_F8B19C - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13074 if ( dword_F8B19C == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13076 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13077 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13078 sub_4B46A5(pGlobalTXT_LocalizationStrings[197], 0);// "Select the Item to Identify"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13080 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 v2 = pMouse->GetCursorPos(&a2)->x - 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 v117 = (v2 >> 5) + 14 * ((pMouse->GetCursorPos(&v98)->y - 17) >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13084 result = (int)pMouse->GetCursorPos(&v111);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13085 if ( *(int *)result > 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13087 result = (int)pMouse->GetCursorPos(&v103);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13088 if ( *(int *)result < 462 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13090 result = v0->GetItemIDAtInventoryIndex((int *)&v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13091 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13092 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13094 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 v94 = 4;
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13096 v4 = &_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * result + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13097 if ( v4[20] & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13099 v5 = sub_495461("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)ptr_507BC0->ptr_1C, 4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 v97 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13101 v95 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 v92 = white;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 v6 = (212 - pFontArrus->CalcTextHeight(v5, &v112, 0, 0)) / 2 + 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104 return (int)v112.DrawText2(pFontArrus, v3, v6, v92, v95, v97);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13106 v93 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13107 v90 = (ItemGen *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13108 v7 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13109 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13110 v8 = ((Player *)_this)->_490EEE((ItemGen *)v4, 3, v7, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13111 v9 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 v10 = (char *)pMerchantsIdentifyPhrases[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13119 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13121 draw_leather();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13122 CharacterUI_InventoryTab_Draw(uActiveCharacter, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13123 sub_4B46A5(pGlobalTXT_LocalizationStrings[199], 0);// "Select the Item to Sell"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13124 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125 if ( !result
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 || (v11 = pMouse->GetCursorPos(&v107)->x - 14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13127 v117 = (v11 >> 5) + 14 * ((pMouse->GetCursorPos(&v99)->y - 17) >> 5),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13128 result = (int)pMouse->GetCursorPos(&v105),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13129 *(int *)result <= 13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13130 || (result = (int)pMouse->GetCursorPos(&v101), *(int *)result >= 462)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13131 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13132 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13133 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13134 v94 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13135 v93 = ptr_507BC0->ptr_1C;
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13136 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * result + 5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137 v12 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13139 v13 = _this->_490EEE(v90, 3, v12, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13140 v9 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13141 v10 = (char *)pMerchantsSellPhrases[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13142 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13143 v30 = sub_495461(v10, v9, v90, (char *)v93, v94, v96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13144 v97 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13145 v95 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13146 v92 = white;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13147 v91 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13148 v89 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13149 v88 = &v112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13150 LABEL_61:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151 v6 = (174 - pFontArrus->CalcTextHeight(v30, v88, v89, v91)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13152 return (int)v112.DrawText2(pFontArrus, v3, v6, v92, v95, v97);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13156 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13157 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13158 v122 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13159 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13161 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13163 if ( pParty->field_777C[9 * (v49 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13165 v50 = dword_F8B168[v49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13166 v51 = 152 - v50->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13167 if ( (signed int)v51 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13168 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13169 v52 = 75 * v49 - v50->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13170 if ( v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 if ( v122 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13174 v53 = dword_F8B168[5]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13175 if ( (signed int)v52 > 457 - v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13176 v52 = 457 - v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181 if ( (signed int)v52 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13182 v52 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13184 pRenderer->DrawTextureTransparent(v52, v51, v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13185 sub_40F92A(&pRenderer->pActiveZBuffer[v52 + 640 * v51], dword_F8B168[v122], v122 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13186 v49 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13188 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 v122 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 while ( v49 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 v122 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195 if ( pParty->field_777C[9 * (v122 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 54] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 v54 = dword_F8B168[v122 + 6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 v55 = 306 - v54->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13199 v56 = 75 * v122 - v54->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13200 if ( v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13202 if ( v122 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13204 v57 = dword_F8B168[11]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 if ( (signed int)v56 > 457 - v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 v56 = 457 - v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13209 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13211 if ( (signed int)v56 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13212 v56 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 pRenderer->DrawTextureTransparent(v56, v55, v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 sub_40F92A(&pRenderer->pActiveZBuffer[v56 + 640 * v55], dword_F8B168[v122 + 6], v122 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13217 ++v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13219 while ( v122 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13221 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 if ( pParty->field_C59C[9 * (v49 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13227 v58 = dword_F8B168[v49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13228 v59 = 152 - v58->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13229 if ( (signed int)v59 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13231 v60 = 75 * v49 - v58->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13232 if ( v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13234 if ( v122 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13236 v61 = dword_F8B168[5]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13237 if ( (signed int)v60 > 457 - v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13238 v60 = 457 - v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13241 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13243 if ( (signed int)v60 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13244 v60 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13246 pRenderer->DrawTextureTransparent(v60, v59, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13247 sub_40F92A(&pRenderer->pActiveZBuffer[v60 + 640 * v59], dword_F8B168[v122], v122 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13248 v49 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13250 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13251 v122 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13253 while ( v49 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13254 v122 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13255 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13257 if ( pParty->field_C59C[9 * (v122 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 778] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13259 v62 = dword_F8B168[v122 + 6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13260 v63 = 306 - v62->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13261 if ( (signed int)v63 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13262 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13263 v64 = 75 * v122 - v62->uTextureWidth / 2 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13264 if ( v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13266 if ( v122 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13268 v65 = dword_F8B168[11]->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13269 if ( (signed int)v64 > 457 - v65 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13270 v64 = 457 - v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13273 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13275 if ( (signed int)v64 < 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13276 v64 = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13278 pRenderer->DrawTextureTransparent(v64, v63, v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13279 sub_40F92A(&pRenderer->pActiveZBuffer[v64 + 640 * v63], dword_F8B168[v122 + 6], v122 + 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13281 ++v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13283 while ( v122 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13285 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13286 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13288 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13289 v117 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13290 if ( dword_F8B19C == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13292 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13294 if ( pParty->field_777C[9 * (v66 + 12 * (unsigned int)ptr_507BC0->ptr_1C)] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13295 ++v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13296 ++v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 while ( v66 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13300 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13302 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13304 if ( pParty->field_C59C[9 * (v66 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 724] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13305 ++v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13306 ++v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13308 while ( v66 < 12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 v67 = GetAsyncKeyState(VK_CONTROL);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 v68 = _this->CanSteal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312 Str = (char *)v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313 if ( v67 && v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315 v69 = pGlobalTXT_LocalizationStrings[185];// "Steal item"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319 v69 = pGlobalTXT_LocalizationStrings[195];// "Select the Item to Buy"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13320 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13321 v69 = pGlobalTXT_LocalizationStrings[196];// "Select the Special Item to Buy"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13323 sub_4B46A5(v69, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13324 if ( !v117 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325 return (int)v112._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13326 __PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13327 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C + 1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13328 pParty->field_3C.field_50[2 * (unsigned int)ptr_507BC0->ptr_1C])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13329 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330 v70 = pMouse->GetCursorPos(&v102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331 result = v70->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v100)->y];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334 v71 = (pRenderer->pActiveZBuffer[result] & 0xFFFF) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 v117 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336 v72 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13337 v73 = 9 * (v71 + 12 * v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13338 v74 = (ItemGen *)&pParty->field_777C[v73];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340 v74 = (ItemGen *)&pParty->field_C59C[v73 + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13341 if ( v67 && Str )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13343 v10 = pGlobalTXT_LocalizationStrings[181];// "Steal %24"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13344 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13345 v94 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13346 v93 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347 v90 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 v9 = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13350 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13352 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13353 v94 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13354 v93 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13355 v90 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13356 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13357 v75 = _this->_490EEE(v74, 3, v72, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13358 v9 = uPlayerID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13359 v10 = (char *)pMerchantsBuyPhrases[v75];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13361 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13367 //----- (004BC49B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13368 void __thiscall sub_4BC49B(unsigned int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13370 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13371 NPCData *v2; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13372 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13373 int v4; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13374 signed int v5; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13375 char *v6; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13376 const char *v7; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13377 signed int v8; // edi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13378 unsigned int v9; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 unsigned int v10; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380 void *v11; // [sp-Ch] [bp-1Ch]@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 int v12; // [sp-8h] [bp-18h]@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382 char *v13; // [sp-8h] [bp-18h]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13383 size_t v14; // [sp-4h] [bp-14h]@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 const char *v15; // [sp-4h] [bp-14h]@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13386 v1 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13387 v2 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13388 v3 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13389 uDialogueType = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13390 if ( !v2->uFlags )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13392 v2->uFlags = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13393 v3 = uDialogueType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13395 if ( (signed int)v3 > 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13397 if ( v3 == 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399 v4 = v2->evte;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13400 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13402 if ( v3 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13404 v4 = v2->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13405 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13407 if ( v3 != 76 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13409 if ( v3 == 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13411 byte_F8B1EC ^= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 if ( (signed int)v3 > 84 && (signed int)v3 <= 88 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 ArenaFight();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13418 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13421 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13423 if ( v2->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13425 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13426 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13428 v6 = (char *)pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13429 while ( !(v6[8] & 0x80) || strcmp(v2->pName, *(const char **)v6) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 v6 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433 if ( v8 >= (signed int)pNPCStats->uNumNewNPCs )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13436 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13438 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13439 if ( !pParty->pHirelings[0].pName || _strcmpi(pParty->pHirelings[0].pName, v2->pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13441 if ( !pParty->pHirelings[1].pName || _strcmpi(pParty->pHirelings[1].pName, v2->pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13443 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13444 pParty->field_709 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13445 sub_44A56A();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13446 dword_591084 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13454 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13456 v14 = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13457 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13458 v11 = &pParty->pHirelings[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13460 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13462 v14 = 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13463 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13464 v11 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466 memset(v11, v12, v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471 v7 = pGlobalTXT_LocalizationStrings[533]; // ""I cannot join you, you're party is full""
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 ShowStatusBarString(v7, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13476 v9 = v2->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13477 if ( v9 != 51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13479 v10 = *(&pNPCStats->field_13A58 + 5 * v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13480 if ( pParty->uNumGold < v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13482 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);// "You don't have enough gold"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13483 byte_F8B1EC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13484 uDialogueType = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13485 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13486 pPlayers[uActiveCharacter]->PlaySound(38, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13487 v7 = pGlobalTXT_LocalizationStrings[155];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 Party::TakeGold(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 LOBYTE(v2->uFlags) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493 if ( pParty->pHirelings[0].pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 memcpy(&pParty->pHirelings[1], v2, sizeof(pParty->pHirelings[1]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13496 v15 = v2->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497 v13 = pParty->pHireling2Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 memcpy(pParty->pHirelings, v2, 0x4Cu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 v15 = v2->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13503 v13 = pParty->pHireling1Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13505 strcpy(v13, v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13506 pParty->field_709 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13507 sub_44A56A();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13508 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13510 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13511 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13512 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13513 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13515 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13516 pDialogue_SpeakingActor->uAIState = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13517 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13518 pPlayers[uActiveCharacter]->PlaySound(61, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13519 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13521 if ( v3 == 22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13523 v4 = v2->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13524 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13526 if ( v3 == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13528 if ( !sub_4BB756(v2->uProfession) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530 if ( v2->uProfession != 41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531 v2->bHasUsedTheAbility = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13536 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13537 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 v7 = pGlobalTXT_LocalizationStrings[140];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13544 if ( v3 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13546 if ( !(v2->uFlags & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13548 sub_4B3E1E();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13549 byte_F8B1EC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13552 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13553 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 v6 = (char *)pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13556 while ( !(v6[8] & 0x80) || strcmp(v2->pName, *(const char **)v6) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13559 v6 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 if ( v5 >= (signed int)pNPCStats->uNumNewNPCs )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13564 v6[8] &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13565 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13569 if ( v3 == 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571 v4 = v2->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13574 if ( v3 == 20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13576 v4 = v2->evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13577 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13579 if ( v3 == 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13581 v4 = v2->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13582 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13583 if ( v4 < 200 || v4 > 310 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 if ( v4 < 400 || v4 > 410 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13587 switch ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 case 139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590 sub_4B1ECE();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13591 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 case 311:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13593 sub_4BBA85_bounties();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13595 case 399:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13596 sub_4BBCDD();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13597 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13598 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599 _5C3420_pDecoration = (LevelDecoration *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600 ptr_F8B1E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601 EventProcessor(v4, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13603 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13606 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13608 dword_F8B1D8 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 sub_4B3EF0(v4 - 400);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13612 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614 sub_4B3FE5(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13618 if ( !dword_7241C8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13619 pGame->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13620 LABEL_89:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13621 dword_7241C8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13626 //----- (004BDAAF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 bool __fastcall sub_4BDAAF(ItemGen *a1, int _2da_idx)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630 unsigned int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13631 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 signed int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13633 int v6; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13634 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13635 int v8; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13636 unsigned __int8 v9; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 char v10; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638 unsigned __int8 v11; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13639
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 auto a2 = _2da_idx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641 //v2 = p2DEvents_minus1___00[26 * a2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13642 v2 = p2DEvents[a2 - 1].uType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13643 v3 = a1->uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 v4 = a1->uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645 v5 = pItemsTable->pItems[v4].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646 if ( (v2 != 4 || (signed int)v3 < 740 || (signed int)v3 > 771)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 && ((signed int)v3 >= 600 || (signed int)v3 >= 529 && (signed int)v3 <= 599)
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13648 || BYTE1(a1->uAttributes) & 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13650 v6 = v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13651 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653 v11 = __OFSUB__(v5, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13654 v9 = v5 == 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13655 v10 = v5 - 2 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13656 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658 v7 = v6 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13659 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13661 v8 = v7 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13662 if ( !v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13664 if ( pItemsTable->pItems[v4].uSkillType != 38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13665 return v5 == 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13668 if ( v8 != 1 || v5 < 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13669 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13670 if ( v5 <= 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13671 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13672 if ( v5 != 17 || (signed int)v3 < 740 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13673 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674 v11 = __OFSUB__(v3, 771);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675 v9 = v3 == 771;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676 v10 = ((v3 - 771) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13677 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13678 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13679 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13680 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13682 if ( v5 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13684 v11 = __OFSUB__(v5, 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13685 v9 = v5 == 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 v10 = v5 - 9 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694 //----- (004B5D7C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13695 int __cdecl sub_4B5D7C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13697 GUIWindow *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13698 Player *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13699 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 int v3; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13701 int result; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13702 unsigned int v5; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 int v6; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704 signed int v7; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13705 int v8; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 signed int v9; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 char *v10; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 const char *v11; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 POINT *v12; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710 int v13; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 void *v14; // ST1C_4@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 ItemGen *v15; // ST18_4@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 int v16; // ST10_4@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714 int v17; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715 char *v18; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716 int v19; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 GUIWindow *v20; // edi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718 int v21; // esi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13719 int v22; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720 unsigned int v23; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 int v24; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722 int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 int v26; // ecx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724 GUIButton *v27; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 GUIButton *v28; // esi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726 unsigned int v29; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 char *v30; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728 int v31; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 unsigned int v32; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730 int v33; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 unsigned __int16 v34; // ax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732 int v35; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 const char *v36; // ST20_4@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13734 unsigned __int16 v37; // ST1C_2@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13735 int v38; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13736 GUIWindow *v39; // [sp-18h] [bp-304h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13737 int v40; // [sp-14h] [bp-300h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738 int v41; // [sp-10h] [bp-2FCh]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13739 unsigned __int16 v42; // [sp-Ch] [bp-2F8h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740 char *v43; // [sp-8h] [bp-2F4h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 unsigned int v44; // [sp-4h] [bp-2F0h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742 char Dest[100]; // [sp+Ch] [bp-2E0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 char v46[100]; // [sp+70h] [bp-27Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13744 char v47[100]; // [sp+D4h] [bp-218h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 char v48[100]; // [sp+138h] [bp-1B4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746 char v49[100]; // [sp+19Ch] [bp-150h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 POINT v50; // [sp+264h] [bp-88h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748 POINT v51; // [sp+26Ch] [bp-80h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 GUIWindow v52; // [sp+274h] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 signed int v53; // [sp+27Ch] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13751 signed int v54; // [sp+284h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13752 int v55; // [sp+2C8h] [bp-24h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13753 int v56; // [sp+2CCh] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13754 int v57; // [sp+2D0h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13755 Player *v58; // [sp+2D4h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756 unsigned __int8 uPlayerID; // [sp+2DBh] [bp-11h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757 char *Str; // [sp+2DCh] [bp-10h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 int v61; // [sp+2E0h] [bp-Ch]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13759 unsigned int v62; // [sp+2E4h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13760 int v63; // [sp+2E8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13761
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13762 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13763 memcpy(&v52, ptr_507BC0, sizeof(v52));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13764 v58 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13765 v1 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13766 v52.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13767 v53 = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13768 v54 = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13769 v56 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13770 v57 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13771 //v2 = (signed __int64)(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13772 v2 = (signed __int64)(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 v63 = v2 * (100 - v1->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 if ( v63 < v2 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 v63 = v2 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13776 strcpy(Dest, nullstring);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13777 strcpy(v46, nullstring);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13778 strcpy(v47, nullstring);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13779 strcpy(v48, nullstring);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13780 strcpy(v49, nullstring);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13781 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13783 if ( dword_F8B19C != 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13785 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13787 v3 = (int)(&v1->uIntelligence + dword_F8B19C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13788 if ( *(short *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13790 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[403], pClassNames[dword_F8B19C + 20]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13791 ShowStatusBarString(pTmpBuf, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13794 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13796 if ( pParty->uNumGold < v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13798 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13799 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13801 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13803 Party::TakeGold(v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13804 *(short *)v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13808 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13809 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13811 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13813 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13814 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13815 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13817 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13819 pRenderer->DrawTextureIndexed(8u, 8u, dword_F8B164);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13820 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13821 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13822 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13823 v63 = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13824 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13826 if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v6 + 12 * (unsigned int)ptr_507BC0->ptr_1C)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13828 pRenderer->DrawTextureTransparent(v63, 0x5Au, dword_F8B168[v6]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13829 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 230528), dword_F8B168[v6], v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13830 v1 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13832 v63 += 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 v62 += 280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13836 while ( v63 < 452 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13837 v62 = 1680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13838 v7 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13839 v63 = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13840 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 if ( *(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 9 * (v7 + 12 * (unsigned int)ptr_507BC0->ptr_1C)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 pRenderer->DrawTextureTransparent(v63, 0xFAu, dword_F8B168[v7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13845 ZBuffer_DoFill((int *)((char *)pRenderer->pActiveZBuffer + v62 + 638448), dword_F8B168[v7], v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13846 v1 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13848 v63 += 70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 v62 += 280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 while ( v63 < 452 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13853 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13854 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13857 v9 = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13858 v10 = (char *)(&pParty->pPlayers[1].pInstalledBeacons[0].field_18 + 108 * (unsigned int)ptr_507BC0->ptr_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13859 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13861 if ( *(int *)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13863 v10 += 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13864 --v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 while ( v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867 GetAsyncKeyState(17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 v11 = pGlobalTXT_LocalizationStrings[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 if ( dword_F8B19C != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13870 v11 = pGlobalTXT_LocalizationStrings[196];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13871 sub_4B46A5(v11, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13872 if ( !v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13873 return (int)v52._4B1854(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13874 __PAIR__(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13875 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)ptr_507BC0->ptr_1C + 44472],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13876 *(int *)&stru_AA1058[3].pSounds[8 * (unsigned int)ptr_507BC0->ptr_1C + 44468])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13877 - pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13878 v12 = pMouse->GetCursorPos(&v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13879 result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13880 v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13881 if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13883 v14 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13884 v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)v14));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13885 v16 = (int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13886 uPlayerID = uActiveCharacter - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13887 v17 = v1->_490EEE(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13888 (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)v14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13889 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13890 v16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13891 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13892 v18 = sub_495461((char *)pMerchantsBuyPhrases[v17], uPlayerID, v15, (char *)v14, 2, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13893 v44 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13894 v43 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13895 v42 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13896 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13897 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13898 v39 = &v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13899 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13900 v19 = pFontArrus->CalcTextHeight(v18, v39, v40, v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13901 return (int)v52.DrawText2(pFontArrus, v5, (174 - v19) / 2 + 138, v42, v43, v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13904 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13906 if ( !(unsigned __int16)_449B57_test_bit(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13907 (unsigned __int8 *)v1->field_152,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13908 word_4F0704[2 * (unsigned int)ptr_507BC0->ptr_1C]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13909 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13910 v36 = pNPCTopics[121].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13911 v37 = v57;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
13912 v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &v52, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13913 v52.DrawText2(pFontArrus, 0, (212 - v38) / 2 + 101, v37, v36, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13914 result = (int)pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13915 pDialogueWindow->field_28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13916 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13918 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13919 if ( !result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13920 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13921 v20 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13922 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13923 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13924 Str = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13925 v21 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13926 v22 = v21 + pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13927 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13928 if ( v21 >= v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13929 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13930 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13932 v23 = v20->GetControl(v21)->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13933 if ( v23 == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13935 v25 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[400], &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13936 v62 += v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13937 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13939 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13940 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13941 __debugbreak();
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13942 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13943 // or
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13944 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13945 // or
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13946 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13947
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13948 //if ( *(&byte_4ED94C[37 * v58->uClass] + v23) && !*(&v58->uIntelligence + v23) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13950 v24 = pFontArrus->CalcTextHeight(pClassNames[v23 + 20], &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13951 v62 += v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13952 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13953 ++Str;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13956 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13958 while ( v21 < v20->field_28 + v20->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13959 if ( !v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13961 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13962 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v58->pName, pClassNames[v58->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13963 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13964 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13965 v18 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13966 v44 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13967 v43 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13968 v42 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13969 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13971 v39 = &v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13974 if ( Str )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13977 v52.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13979 v63 = (signed int)(149 - v62) / v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13980 if ( v63 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13981 v63 = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13982 result = v20->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13983 v26 = (signed int)(149 - v61 * v63 - v62) / 2 - v63 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13984 v62 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13985 v55 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13986 if ( result < result + v20->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13988 v61 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13989 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13991 v27 = v20->GetControl(v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13992 v28 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13993 v29 = v27->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13994 if ( v29 == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995 break;
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13996
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13997 __debugbreak();
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13998 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13999 // or
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14000 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14001 // or
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14002 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14003
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14004 //if ( *(&byte_4ED94C[37 * v58->uClass] + v29) && !*(&v58->uIntelligence + v29) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14006 v30 = pClassNames[v29 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14007 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14008 Str = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14009 v28->uY = v63 + v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14010 v31 = pFontArrus->CalcTextHeight(v30, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14011 v32 = v28->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14012 v28->uHeight = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14013 v33 = v32 + v31 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14014 v28->uW = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14015 v55 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 v34 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14017 if ( pDialogueWindow->field_2C_focus_id != v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14018 v34 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 v52.DrawText2(pFontArrus, 0, v32, v34, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14022 v28->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14023 v28->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14024 v28->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14025 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026 v35 = v20->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14027 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14028 result = v20->field_28 + v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14030 if ( (signed int)v62 >= result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14031 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033 v30 = pGlobalTXT_LocalizationStrings[400];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14036 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14038
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14040
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14041 //----- (004B705E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14042 int __cdecl sub_4B705E()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14044 GUIWindow *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 Player *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14046 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047 int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14048 GUIWindow *v4; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14049 void *v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14050 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14051 unsigned int v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14052 int v8; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14053 unsigned int v9; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14054 int v10; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14055 int v11; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14056 GUIWindow *v12; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14057 int v13; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14058 GUIButton *v14; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14059 GUIButton *v15; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14060 int v16; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14061 const char *v17; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14062 int v18; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14063 unsigned int v19; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14064 int v20; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14065 unsigned __int16 v21; // ax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14066 unsigned __int16 v22; // ST14_2@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14067 int v23; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14068 double v24; // st7@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14069 unsigned int v25; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14070 DDM_DLV_Header *v26; // edi@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14071 int v27; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14072 int v28; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14073 unsigned int v29; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14074 unsigned int v30; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14075 unsigned int v31; // edx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14076 unsigned int v32; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14077 unsigned int v33; // edx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078 unsigned int v34; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14079 int v35; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 signed int v36; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14081 unsigned __int8 v37; // al@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14082 int v38; // ecx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14083 GUIWindow *v39; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14084 unsigned __int8 v40; // al@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14085 GUIButton *v41; // edi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14086 int v42; // esi@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087 GUIWindow *v43; // ecx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088 int v44; // edi@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14089 int v45; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14090 signed int v46; // edi@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091 int v47; // edi@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 GUIButton *v48; // eax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 const char *v49; // edx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 GUIButton *v50; // esi@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095 int v51; // eax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096 unsigned int v52; // ecx@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14097 unsigned __int16 v53; // ax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14098 char a1[100]; // [sp+10h] [bp-1B4h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14099 char Dest; // [sp+74h] [bp-150h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14100 char v56; // [sp+D8h] [bp-ECh]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14101 GUIWindow v57; // [sp+13Ch] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 __int64 v58; // [sp+190h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14103 __int64 v59; // [sp+198h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14104 __int64 v60; // [sp+1A0h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 GUIWindow *v61; // [sp+1ACh] [bp-18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 unsigned int v62; // [sp+1B0h] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 unsigned __int8 v63; // [sp+1B7h] [bp-Dh]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 int v64; // [sp+1B8h] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14109 unsigned int v65; // [sp+1BCh] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14110 DDM_DLV_Header *v66; // [sp+1C0h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14113 memcpy(&v57, ptr_507BC0, sizeof(v57));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 v57.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14115 v57.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14116 v57.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14117 HIDWORD(v58) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14118 HIDWORD(v59) = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14119 v1 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14120 //v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents_minus1__20[13 * (unsigned int)v0->ptr_1C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14121 v2 = pPlayers[uActiveCharacter]->_4B807C(p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14122 HIDWORD(v60) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14123 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14125 if ( dword_F8B19C != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14127 if ( dword_F8B19C != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14129 result = dword_F8B19C - 96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14130 if ( dword_F8B19C == 96 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14132 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14133 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14135 v4 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14136 v61 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14137 v5 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14138 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14139 //v65 = (signed __int64)(*(float *)&p2DEvents_minus1__24[13 * (signed int)v5] * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14140 v65 = (signed __int64)(p2DEvents[(signed int)v5 - 1].flt_24 * 500.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 v6 = v1->GetMerchant();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14142 v64 = (signed int)(v65 * (100 - v6)) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14143 if ( v64 < (signed int)v65 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14144 v64 = (signed int)v65 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14145 v7 = v4->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14146 v8 = v7 + v4->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14147 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14148 v62 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14149 if ( (signed int)v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14150 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14153 v9 = v4->GetControl(v62)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14154 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->uClass][v9] && !v1->pActiveSkills[v9] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 v10 = pFontArrus->CalcTextHeight(pSkillNames[v9], &v57, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 v66 = (DDM_DLV_Header *)((char *)v66 + v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14158 ++v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14160 v11 = v4->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14161 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14163 while ( (signed int)v62 < v4->field_28 + v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14164 if ( v65 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v64);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 v57.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 v64 = (149 - (signed int)v66) / (signed int)v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 if ( v64 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14170 v64 = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14171 v65 = (signed int)(149 - v65 * v64 - (int)v66) / 2 - v64 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14172 v12 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 result = v61->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14174 v13 = result + v61->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14175 v62 = v61->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 if ( result < v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14178 v66 = (DDM_DLV_Header *)2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14179 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 v14 = v12->GetControl(v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14182 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183 v16 = v14->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14184 if ( !byte_4ED970_skill_learn_ability_by_class_table[v1->uClass][v16] || v1->pActiveSkills[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186 v15->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 v15->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14188 v15->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14190 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14192 v17 = pSkillNames[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 v15->uY = v64 + v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14194 HIDWORD(v60) = (uint32)v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14195 v18 = pFontArrus->CalcTextHeight(v17, &v57, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 v19 = v15->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 v15->uHeight = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 v20 = v19 + v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14199 v15->uW = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 v65 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14201 v21 = WORD2(v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202 if ( (DDM_DLV_Header *)pDialogueWindow->field_2C_focus_id != v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203 v21 = WORD2(v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204 v57.DrawText2(pFontArrus, 0, v19, v21, (const char *)HIDWORD(v60), 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14206 result = (int)v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 v66 = (DDM_DLV_Header *)((char *)v66 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 if ( (signed int)v62 >= v61->field_28 + v61->field_38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14211 v12 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14218 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221 v22 = WORD2(v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14222 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v57, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14223 result = (int)v57.DrawText2(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 //v24 = p2DEvents_minus1__20[13 * (unsigned int)ptr_507BC0->ptr_1C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14230 v24 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].fPriceMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14231 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232 if ( pParty->uNumGold >= (unsigned int)(signed __int64)v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 Party::TakeGold((signed __int64)v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235 v26 = &pOutdoor->ddm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237 v26 = &pIndoor->dlv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238 v27 = v26->uReputation;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239 v66 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14240 if ( v27 > -5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242 v28 = v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 v26->uReputation = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 if ( v28 < -5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245 v26->uReputation = -5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14247 v29 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14248 if ( (unsigned __int8)byte_F8B1EF[uActiveCharacter] == pParty->uDaysPlayed % 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 if ( v26->uReputation <= -5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 v30 = pParty->uDaysPlayed % 7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 LOBYTE(v30) = v30 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 _42777D_CastSpell_UseWand_ShootArrow(12, uActiveCharacter - 1, v30, 48, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 v29 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257 if ( v26->uReputation <= -10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 v31 = pParty->uDaysPlayed % 7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 LOBYTE(v31) = v31 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 _42777D_CastSpell_UseWand_ShootArrow(50, v29 - 1, v31, 48, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 v29 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263 v26 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265 if ( v26->uReputation <= -15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267 v32 = pParty->uDaysPlayed % 7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 LOBYTE(v32) = v32 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14269 _42777D_CastSpell_UseWand_ShootArrow(75, v29 - 1, v32, 48, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 v29 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271 v26 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273 if ( v26->uReputation <= -20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 v33 = pParty->uDaysPlayed % 7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 LOBYTE(v33) = v33 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277 _42777D_CastSpell_UseWand_ShootArrow(86, v29 - 1, v33, 48, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 v29 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 v26 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 if ( v26->uReputation <= -25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 v34 = pParty->uDaysPlayed % 7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 LOBYTE(v34) = v34 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285 _42777D_CastSpell_UseWand_ShootArrow(85, v29 - 1, v34, 48, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 v29 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 ++byte_F8B1EF[v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290 v1->PlaySound(83, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291 ShowStatusBarString(pGlobalTXT_LocalizationStrings[527], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 result = v1->_4B6FF9();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 if ( !result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300 if ( pParty->uNumGold < v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 Party::TakeGold(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 v35 = LODWORD(v1->pConditions[17]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309 v59 = v1->pConditions[14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310 v58 = v1->pConditions[15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311 v60 = v1->pConditions[16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 v61 = (GUIWindow *)HIDWORD(v1->pConditions[17]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 memset(v1, 0, 0xA0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 v1->sHealth = v1->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315 v1->sMana = v1->GetMaxMana();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14316 v36 = (signed int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 if ( v36 != 78 && (v36 <= 80 || v36 > 82) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 if ( (unsigned int)v61 | v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321 v37 = LOBYTE(v1->field_1928);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 v38 = v1->field_1924;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323 v1->uFace = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 v1->uVoiceID = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 v39 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 if ( (unsigned int)v61 | v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332 LODWORD(v1->pConditions[17]) = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 if ( !v60 && !v58 && !v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338 v1->field_1928 = v1->uFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 v1->field_1924 = v1->uVoiceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 v1->SetCondition(0x11u, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 v1->uVoiceID = (v1->GetSexByVoice() != 0) + 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 v40 = (v1->GetSexByVoice() != 0) + 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 v1->uFace = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 ReloadPlayerPortraits(uActiveCharacter - 1, (char)v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14345 LODWORD(v1->pConditions[17]) = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 v39 = (GUIWindow *)HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348 HIDWORD(v1->pConditions[17]) = (int)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x2), -1, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 v1->PlaySound(82, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 pOtherOverlayList->_4418B1(20, uActiveCharacter + 99, 0, 65536);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14355 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14358 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 *(&pMessageQueue_50CBD0->uNumMessages + result) = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365 v63 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 v41 = pDialogueWindow->GetControl(pDialogueWindow->field_38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 strcpy(a1, nullstring);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 v41->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 v41->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370 if ( v1->_4B6FF9() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 sprintfex(a1, "%s %d %s", pGlobalTXT_LocalizationStrings[104], HIDWORD(v60), pGlobalTXT_LocalizationStrings[97]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 strcpy(&Dest, pGlobalTXT_LocalizationStrings[68]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 strcpy(&v56, pGlobalTXT_LocalizationStrings[160]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 v42 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378 v43 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 v44 = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 if ( v63 < pDialogueWindow->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 v61 = (GUIWindow *)&a1[100 * v63];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 v45 = pFontArrus->CalcTextHeight((const char *)v61, &v57, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387 v66 = (DDM_DLV_Header *)((char *)v66 + v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388 v43 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14389 v61 = (GUIWindow *)((char *)v61 + 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14390 ++v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14392 while ( v44 < pDialogueWindow->field_28 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 v46 = v43->field_28 - v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395 v64 = (174 - (signed int)v66) / v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 if ( v64 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397 v64 = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 result = v43->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 v47 = (174 - v64 * v46 - (signed int)v66) / 2 - v64 / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 v65 = v42 + result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401 if ( v42 + result < result + v43->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 v61 = (GUIWindow *)(v42 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14404 v66 = (DDM_DLV_Header *)&a1[100 * v42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14407 v48 = v43->GetControl(v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 v49 = (const char *)v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14409 v50 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14410 v48->uY = v64 + v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14411 v51 = pFontArrus->CalcTextHeight(v49, &v57, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 v52 = v50->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 v50->uHeight = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 v47 = v52 + v51 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415 v50->uW = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416 v53 = WORD2(v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 if ( (GUIWindow *)pDialogueWindow->field_2C_focus_id != v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418 v53 = WORD2(v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 v57.DrawText2(pFontArrus, 0, v52, v53, (const char *)v66, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420 v43 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14421 v66 = (DDM_DLV_Header *)((char *)v66 + 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 v61 = (GUIWindow *)((char *)v61 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14423 ++v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14424 result = pDialogueWindow->field_28 + pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 while ( (signed int)v65 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433 //----- (004B8F94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 void *__cdecl sub_4B8F94()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 GUIWindow *v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 signed int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14439 signed int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 int v4; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14441 int v5; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14442 int v6; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 bool v7; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14444 bool v8; // ST1C_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 int v9; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 int v10; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 void *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448 signed int v12; // [sp-4h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14450 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 v2 = (int)&ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 v3 = (signed int)ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)ptr_507BC0->ptr_1C]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 while ( v3 > 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 if ( v3 <= 28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14461 v7 = v1 > 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463 v9 = 5 * (v7 + 2 * v3 - 30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 v3 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465 v5 = word_4F06D8[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466 v6 = word_4F05AE[5 * (v8 + 2 * v3) + rand() % 4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14467 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 if ( v3 <= 41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471 v5 = word_4F07B6[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 v12 = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475 if ( v3 <= 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 if ( v1 >= 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14479 v5 = word_4F07B6[v3 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 v12 = 44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482 v6 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14484 pItemsTable->GenerateItem(v5, v6, (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14485 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14486 v2 = (int)&ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14487 pParty->field_C59C[9 * (v1 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 729] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 auto _a = (ItemGen *)&pParty->field_C59C[9 * (v1 + 12 * v3) + 724];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 _a->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 v2 = (int)&v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14493 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14494 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14495 pParty->field_C59C[9 * (v1 + 12 * *(int *)v2) + 724] = v10 % 32 + 740;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14497 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14498 v3 = *(int *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14499 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14500 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * *(int *)v2]] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14501 if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents[*(int *)v2 - 1].uType] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14502 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14504 v4 = 5 * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14505 v3 = (signed int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14506 v5 = word_4F063E[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14507 v6 = word_4F063E[5 * v3 + rand() % 4 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14508 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14510 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14511 result = v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14512 *(int *)&pParty->field_16154[4 * (int)result] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14513 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14515
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14516
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14517 //----- (004B6478) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14518 int __cdecl sub_4B6478()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14520 GUIWindow *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14521 Player *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14522 unsigned int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14523 signed int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14524 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14525 unsigned int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14526 int v6; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14527 int result; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14528 GUIWindow *v8; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14529 int v9; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14530 int v10; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 unsigned int v11; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532 int v12; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14533 int v13; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14534 GUIButton *v14; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14535 int v15; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536 unsigned int v16; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14537 const char *v17; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538 int v18; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14539 unsigned int v19; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540 int v20; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 unsigned __int16 v21; // ax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 unsigned __int16 v22; // ST14_2@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543 int v23; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544 const char *v24; // ST18_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545 unsigned __int16 v25; // ST14_2@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546 int v26; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547 int v27; // [sp-4h] [bp-80h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 GUIWindow v28; // [sp+Ch] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 GUIWindow *v29; // [sp+60h] [bp-1Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 unsigned int v30; // [sp+64h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 int v31; // [sp+68h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 int v32; // [sp+6Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 int v33; // [sp+70h] [bp-Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 int v34; // [sp+74h] [bp-8h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 int v35; // [sp+78h] [bp-4h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558 memcpy(&v28, ptr_507BC0, sizeof(v28));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 v1 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 v28.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 v28.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 v28.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 v30 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564 v31 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 v2 = 52 * (unsigned int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 //v32 = (unsigned __int8)(((p2DEvents_minus1___00[v2 / 2] != 18) - 1) & 0x96) + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14567 v32 = (unsigned __int8)(((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 18) - 1) & 0x96) + 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 //v3 = (signed __int64)((double)v32 * p2DEvents_minus1__20[v2 / 4]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 v3 = (signed __int64)((double)v32 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 v4 = v3 * (100 - v1->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 v32 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 if ( v4 < v3 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 v4 = v3 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 v32 = v3 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 if ( dword_F8B19C != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 v5 = 0;
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14582
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14583 __debugbreak();
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14584 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14585 // or
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14586 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14587 // or
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14588 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14589
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14590 if (false
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
14591 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592 || (v6 = (int)(&v1->uIntelligence + dword_F8B19C), *(short *)v6) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598 if ( pParty->uNumGold < v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 v27 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 Party::TakeGold(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 *(short *)v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607 v27 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14609 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 result = pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 *(&pMessageQueue_50CBD0->uNumMessages + result) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14623 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14627 if ( !(unsigned __int16)_449B57_test_bit(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 (unsigned __int8 *)v1->field_152,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 word_4F0754[2 * (unsigned int)ptr_507BC0->ptr_1C]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14631 v24 = pNPCTopics[171].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632 v25 = v31;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
14633 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14634 v28.DrawText2(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14635 result = (int)pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14636 pDialogueWindow->field_28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14637 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14639 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14640 if ( !result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14641 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14642 v8 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14643 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14644 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14645 v29 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14646 v9 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14647 v10 = v9 + pDialogueWindow->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14648 v35 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14649 if ( v9 >= v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14650 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14651 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 v11 = v8->GetControl(v35)->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->uClass / 3][v11] && !v1->pActiveSkills[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 v33 += v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14658 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 v13 = v8->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 ++v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 while ( v35 < v8->field_28 + v13 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->uClass]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 v22 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v28, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 return (int)v28.DrawText2(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 v28.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 v32 = (149 - v33) / v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 if ( (149 - v33) / v34 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 v32 = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14679 result = v8->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 v35 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682 if ( result < result + v8->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 v33 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 v14 = v8->GetControl(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 v15 = v14->uControlParam - 36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->uClass / 3][v15] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 if ( !v1->pActiveSkills[v15] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694 v17 = pSkillNames[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14695 v14->uY = v32 + v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14696 v18 = pFontArrus->CalcTextHeight(v17, &v28, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14697 v19 = v14->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 v14->uHeight = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 v20 = v19 + v18 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700 v14->uW = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 v34 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 v21 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703 if ( pDialogueWindow->field_2C_focus_id != v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 v21 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 v28.DrawText2(pFontArrus, 0, v19, v21, v17, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 v14->uW = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 v14->uHeight = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 v14->uY = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 v8 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 ++v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719 ++v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14720 result = v29->field_28 + v29->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 while ( v35 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 //----- (004B6943) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 void __cdecl TravelByTransport()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 GUIWindow *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733 Player *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14736 signed int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14737 char *v5; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14738 int v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740 int v8; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14741 int v9; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14742 int v10; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14743 int v11; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744 signed int v12; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 signed int v13; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14746 DWORD v14; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14747 DWORD v15; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14748 GUIWindow *v16; // ebx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 int v17; // esi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750 int v18; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14751 int v19; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14752 int v20; // esi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14753 int v21; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754 void *v22; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 Player *v23; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 GUIButton *v24; // ebx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757 signed int v25; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14758 int v26; // esi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14759 const char *v27; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14760 char *v28; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14761 int v29; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14762 unsigned int v30; // ecx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 char *v31; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764 char v32; // [sp-3Ch] [bp-2CCh]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 int v33; // [sp-38h] [bp-2C8h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766 int v34; // [sp-34h] [bp-2C4h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767 int v35; // [sp-30h] [bp-2C0h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768 int v36; // [sp-2Ch] [bp-2BCh]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14769 int v37; // [sp-28h] [bp-2B8h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14770 int v38; // [sp-24h] [bp-2B4h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14771 int v39; // [sp-20h] [bp-2B0h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 int v40; // [sp-1Ch] [bp-2ACh]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 int v41; // [sp-18h] [bp-2A8h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14774 int v42; // [sp-14h] [bp-2A4h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14775 char *v43; // [sp-10h] [bp-2A0h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14776 char *v44; // [sp-Ch] [bp-29Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14777 unsigned int v45; // [sp-8h] [bp-298h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778 char *v46; // [sp-4h] [bp-294h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14779 const char *v47[5]; // [sp+0h] [bp-290h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14780 char v48; // [sp+14h] [bp-27Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14781 char v49; // [sp+78h] [bp-218h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782 char v50; // [sp+DCh] [bp-1B4h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 char v51; // [sp+140h] [bp-150h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14784 char Dest; // [sp+1A4h] [bp-ECh]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14785 GUIWindow v53; // [sp+208h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14786 int v54; // [sp+25Ch] [bp-34h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14787 int v55; // [sp+260h] [bp-30h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 unsigned int v56; // [sp+264h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14789 __int16 v57[2]; // [sp+268h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14790 Player *v58; // [sp+26Ch] [bp-24h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14791 GUIWindow *v59; // [sp+270h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 unsigned int v60; // [sp+274h] [bp-1Ch]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14793 Player *v61; // [sp+278h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 int v62; // [sp+27Ch] [bp-14h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 int v63; // [sp+280h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796 char *a1; // [sp+284h] [bp-Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797 unsigned int s1; // [sp+288h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 int v66; // [sp+28Ch] [bp-4h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14799
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14800 v0 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14801 memcpy(&v53, ptr_507BC0, sizeof(v53));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 v61 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 v1 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 v53.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806 v53.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 v53.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808 *(int *)v57 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14809 v56 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14810 v3 = 52 * (unsigned int)v0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14811 //v59 = (GUIWindow *)((((p2DEvents_minus1___00[v3 / 2] != 27) - 1) & 0xFFFFFFE7) + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 v59 = (GUIWindow *)((((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 27) - 1) & 0xFFFFFFE7) + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813 //v4 = (signed __int64)((double)(signed int)v59 * p2DEvents_minus1__20[v3 / 4]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14814 v4 = (signed __int64)((double)(signed int)v59 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14815 s1 = v4 * (100 - v1->GetMerchant()) / 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14816 if ( (signed int)s1 < v4 / 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817 s1 = v4 / 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 if ( dword_F8B19C == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14820 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822 v16 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 v58 = (Player *)-1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14824 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14825 v17 = LOBYTE(pFontArrus->uFontHeight) - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14826 v59 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827 v54 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828 strcpy(&Dest, nullstring);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14829 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[405], s1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14830 v18 = pFontArrus->CalcTextHeight(pTmpBuf2, &v53, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14831 v19 = v16->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832 v20 = v18 + v17 + 146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 v21 = v16->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834 v63 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 v55 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 v60 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837 if ( v21 >= v21 + v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 s1 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 a1 = &v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843 v47[1] = (const char *)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 v22 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845 v23 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14846 v61 = (Player *)(unsigned __int8)*(&_4F0D38_TravelInfo[4 * (signed int)v22] + v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14847 v24 = v16->GetControl(v60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14848 if ( v23 != v58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 && ((signed int)s1 >= 6 ? (v25 = 1) : (v25 = (unsigned __int8)*(&byte_4F09B1[32 * (int)v23]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 + pParty->uDaysPlayed % 7)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851 v25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852 && ((v26 = 8 * (int)v23, !dword_4F09CC[v26])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, LOWORD(dword_4F09CC[v26])))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855 v58 = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856 v27 = (const char *)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 if ( pDialogueWindow->field_2C_focus_id != s1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 v27 = *(const char **)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859 v47[1] = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14860 sprintfex(a1, format_4E2DC8, v27);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14861 v66 = (unsigned __int8)byte_4F09B8[v26 * 4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14862 if ( (signed int)ptr_507BC0->ptr_1C >= 63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14864 if ( CheckHiredNPCSpeciality(8u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865 v66 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 if ( CheckHiredNPCSpeciality(9u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867 v66 -= 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14868 v47[1] = (const char *)45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14870 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 v47[1] = (const char *)35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 if ( CheckHiredNPCSpeciality((unsigned int)v47[1]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875 v66 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 if ( CheckHiredNPCSpeciality(0x2Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14877 --v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14878 if ( v66 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14879 v66 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14880 if ( v61 != (Player *)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 memcpy(&v32, (char *)&pMapStats + 68 * (unsigned __int8)byte_4F09B0[v26 * 4], 0x44u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 sprintfex(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 pTmpBuf,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885 pGlobalTXT_LocalizationStrings[404],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886 v66,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 *(int *)&v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 v33,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 v34,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890 v35,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 v36,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14892 v37,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14893 v38,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14894 v39,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14895 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14896 v41,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14897 v42,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14898 v43,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14899 v44,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900 v45,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 v46,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14902 *(_QWORD *)v47);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14903 strcat(a1, pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14904 v28 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905 a1 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14907 ++s1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14908 strcat(v28, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14909 v24->uY = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910 v29 = pFontArrus->CalcTextHeight(pTmpBuf, &v53, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 v30 = v24->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 v24->uHeight = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913 v2 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914 v24->uW = v30 + v29 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915 v63 += v54 + v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920 v31 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 ++v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 ++s1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 a1 += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 strcpy(v31, nullstring);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14925 if ( v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14927 v24->uW = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 v24->uHeight = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929 v24->uY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14930 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14932 ++v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 if ( (signed int)v60 >= v59->field_28 + v59->field_38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14935 v16 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14937 if ( v63 != v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 v47[1] = &Dest;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14940 v47[0] = &v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14941 v46 = &v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14942 v45 = (unsigned int)&v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14943 v44 = &v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14944 v43 = pTmpBuf2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 sprintfex(pTmpBuf, "%s\n \n%s%s%s%s%s", pTmpBuf2, &v48, &v49, &v50, &v51, &Dest);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946 v53.DrawText2(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 v47[1] = (const char *)3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 v47[0] = pGlobalTXT_LocalizationStrings[561];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 v46 = *(char **)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 v45 = (174 - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[561], &v53, 0, 0)) / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 v53.DrawText2(pFontArrus, 0, v45, (unsigned __int16)v46, v47[0], (unsigned int)v47[1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 if ( dword_F8B19C > 104 && dword_F8B19C <= 108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964 if ( pParty->uNumGold < s1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 goto LABEL_33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 Party::TakeGold(s1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 v47[1] = (const char *)7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 v5 = &byte_4F09B0[32 * (unsigned __int8)*(&byte_4F0CCF[4 * (unsigned int)ptr_507BC0->ptr_1C] + dword_F8B19C)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977 if ( v5[pParty->uDaysPlayed % 7 + 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14979 if ( _strcmpi(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 SaveGame(1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14982 strcpy(pCurrentMapName, pMapStats->pInfos[(unsigned __int8)*v5].pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 v8 = *((int *)v5 + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 v9 = *((int *)v5 + 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14985 v10 = *((int *)v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14986 dword_6BE364_game_settings_1 |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14987 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 _5B65B4_npcdata_loword_house_or_other = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14990 v11 = *((int *)v5 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14991 uGameState = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14992 _5B65A8_npcdata_uflags_or_other = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993 _5B65AC_npcdata_fame_or_other = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994 _5B65B0_npcdata_rep_or_other = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14995 dword_5B65C0 = v11 | v10 | v9 | v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14997 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 v6 = *((int *)v5 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15000 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15001 pParty->vPosition.x = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15002 v7 = *((int *)v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 pIndoorCamera->sRotationY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15005 pParty->vPosition.z = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 pParty->vPosition.y = *((int *)v5 + 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007 pParty->uFallStartY = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 pParty->sRotationY = *((int *)v5 + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010 HousePlaySomeSound((unsigned int)ptr_507BC0->ptr_1C, 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15011 v12 = (unsigned __int8)v5[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012 if ( (signed int)ptr_507BC0->ptr_1C >= 63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 v63 = 72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 v13 = 2500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 if ( CheckHiredNPCSpeciality(8u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15017 v12 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15018 if ( CheckHiredNPCSpeciality(9u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15019 v12 -= 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 v47[1] = (const char *)45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15022 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15024 v63 = 71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 v13 = 1500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026 v47[1] = (const char *)35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 if ( CheckHiredNPCSpeciality((unsigned int)v47[1]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 v12 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 if ( CheckHiredNPCSpeciality(0x2Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 --v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15032 if ( v12 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034 RestAndHeal(1440 * v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035 v61->PlaySound(v63, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036 v14 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037 v15 = v14 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 if ( v15 < v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15039 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15040 while ( GetTickCount() < v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15041 sqrt(3.1415926);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15042 while ( sub_4BD8B5() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15047 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15048 LABEL_33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15049 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15050 ++pMessageQueue_50CBD0->uNumMessages;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15051 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15054 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15056 dword_F8B19C = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15057 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15062
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15063
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15064
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15065
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15066
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15067 //----- (00405CFF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15068 void stru262_TurnBased::End(unsigned int bPlaySound)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15070 stru262_TurnBased *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15071 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15072 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15073 unsigned __int8 v5; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15074 unsigned __int8 v6; // sf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15075 TurnBased_QueueElem *v7; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15076 unsigned __int16 *pAttributes; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15077 size_t v9; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15078 unsigned __int16 v10; // ax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15079 TurnBased_QueueElem *v11; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15080 ObjectType objType; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15081 int objID; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15082 int v14; // [sp+Ch] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15083
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15084 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15085 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15086 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15087 v5 = this->uActorQueueSize == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15088 v6 = this->uActorQueueSize < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15089 this->field_4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15090 if ( !(v6 | v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15092 v7 = this->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15093 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15095 if ( (v7->uPackedID & 7) == OBJECT_Actor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15096 LOBYTE(pActors[v7->uPackedID >> 3].uAttributes) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15097 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15098 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15100 while ( v4 < v2->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15102 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15104 pAttributes = &pLayingItems[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15105 v9 = uNumLayingItems;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15106 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15108 v10 = *pAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15109 if ( *pAttributes & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15111 LOBYTE(v10) = v10 & 0xFB;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15112 *pAttributes = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15114 pAttributes += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15115 --v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15117 while ( v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15119 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15120 if ( v2->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15122 v11 = v2->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15123 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15125 objType = (ObjectType)(v11->uPackedID & 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15126 objID = v11->uPackedID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 if ( objType == OBJECT_Player )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 pPlayers[objID + 1]->uTimeToRecovery = (signed __int64)((double)v11->field_4 * 2.133333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15131 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15133 if ( objType == OBJECT_Actor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15134 pActors[objID].pMonsterInfo.uRecoveryTime = (signed __int64)((double)v11->field_4 * 2.133333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15136 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15137 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15139 while ( v14 < v2->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 if ( bPlaySound != v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15144 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse), v3, v3, -1, v3, v3, v3, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 pTurnEngine->field_18 &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 pEventTimer->StopGameTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 dword_50C994 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 dword_50C998_turnbased_icon_1A = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 // 50C994: using guessed type int dword_50C994;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15151 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 //----- (00405E14) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 void stru262_TurnBased::_405E14()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 stru262_TurnBased *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15157 int v2; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15158 SpellBuff *v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15159 Actor *v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15160 signed int v5; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161 AIDirection *v6; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162 int v7; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163 int v8; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164 int v9; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165 int v10; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 int v11; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 int v12; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 AIDirection a3; // [sp+4h] [bp-68h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 AIDirection v14; // [sp+20h] [bp-4Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170 AIDirection v15; // [sp+3Ch] [bp-30h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171 SpellBuff *v16; // [sp+58h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172 int v17; // [sp+5Ch] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173 stru262_TurnBased *v18; // [sp+60h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 int v19; // [sp+64h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175 unsigned int v20; // [sp+68h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 v18 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183 v3 = pActors[0].pActorBuffs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 v16 = pActors[0].pActorBuffs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 v4 = (Actor *)((char *)&v3[-13] - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15188 if ( SHIDWORD(v3[3].uExpireTime) < v2 || SHIDWORD(v3[3].uExpireTime) <= v2 && LODWORD(v3[3].uExpireTime) <= v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15189 v17 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15190 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15191 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15192 v19 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15195 if ( v19 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15197 v3->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15198 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15203 while ( v19 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15204 if ( v17 != v2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15205 && SHIDWORD(v4->pActorBuffs[3].uExpireTime) <= v2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 && (SHIDWORD(v4->pActorBuffs[3].uExpireTime) < v2 || LODWORD(v4->pActorBuffs[3].uExpireTime) <= v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 v4->uActorHeight = pMonsterList->pMonsters[v4->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208 if ( !(v4->uAttributes & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 if ( !v4->pActorBuffs[5].uExpireTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212 if ( !v4->pActorBuffs[6].uExpireTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214 v5 = v4->uCurrentActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215 v4->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216 if ( (signed int)v4->uCurrentActionTime >= v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 v17 = dword_4F6E08[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 v6 = Actor::GetDirectionInfo(8 * v20 | 3, v17, &a3, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 v7 = v4->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 memcpy(&v15, v6, sizeof(v15));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 v8 = v7 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 memcpy(&v14, &v15, sizeof(v14));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 v9 = v8 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229 v10 = v9 - 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232 if ( v10 != 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233 Actor::_403F58(v20, v17, 32, &v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 v4->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15240 v4->uCurrentActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241 v4->uAIState = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242 v4->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 v1 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15245 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15250 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15251 v3 = (SpellBuff *)((char *)v16 + 836);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15252 v16 = (SpellBuff *)((char *)v16 + 836);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15254 while ( (signed int)v20 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256 if ( v1->field_4 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 v12 = v1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 if ( v12 == 64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 v1->_406A63();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 if ( v12 > v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15267 v1->_406B9F();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 v1->_406AFE();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 v1->field_10 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275 v1->field_8 -= pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15278 if ( v1->field_4 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 if ( !(v1->field_18 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15282 v11 = v1->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15283 if ( v11 == 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15285 v1->StartTurn();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15287 v1->_40652A();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15288 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15290 if ( v11 > v2 || v1->pQueue[0].field_4 <= v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292 v1->_4065B0();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15293 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15296 v1->NextTurn();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15297 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15299 if ( v1->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 if ( v1->uActionPointsLeft <= v2 || v1->field_18 & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 v1->field_18 &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15304 v1->field_4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15305 v1->field_8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15307 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309 v1->_406FA8();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15313
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15315
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15316
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15317 //----- (0043FDED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15318 unsigned int __cdecl PrepareActorRenderList_BLV()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320 RenderBillboard *v0; // esi@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321 unsigned int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15322 char *v2; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15323 unsigned __int16 v3; // ax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15324 unsigned int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15325 unsigned __int16 v5; // cx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15326 int v6; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15327 unsigned int v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15328 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15329 SpriteFrame *v9; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15330 SpriteFrame *v10; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15331 int *v11; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15332 int v12; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15333 Actor *v13; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15334 IndoorCameraD3D **v14; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15335 double v15; // st7@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15336 float v16; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15337 double v17; // ST30_8@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15338 signed __int64 v18; // qtt@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15339 int v19; // ST5C_4@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15340 signed __int64 v20; // qtt@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15341 int v21; // ST5C_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15342 signed __int16 v22; // cx@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15343 int v23; // ST50_4@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15344 signed int v24; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15345 int v25; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15346 __int16 v26; // ax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15347 MonsterDesc *v27; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15348 int v28; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15349 unsigned __int8 v29; // zf@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15350 unsigned __int8 v30; // sf@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15351 unsigned int v31; // [sp-8h] [bp-5Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15352 int v32; // [sp+1Ch] [bp-38h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15353 int a3; // [sp+20h] [bp-34h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15354 int a2; // [sp+24h] [bp-30h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15355 int a1a; // [sp+28h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15356 __int16 a5; // [sp+2Ch] [bp-28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15357 int a5a; // [sp+2Ch] [bp-28h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15358 int a5b; // [sp+2Ch] [bp-28h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15359 unsigned int v39; // [sp+30h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15360 int v40; // [sp+34h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15361 __int16 v41; // [sp+3Ch] [bp-18h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15362 int a6; // [sp+40h] [bp-14h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15363 int v43; // [sp+44h] [bp-10h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15364 int z; // [sp+48h] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15365 signed int y; // [sp+4Ch] [bp-8h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15366 int x; // [sp+50h] [bp-4h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15367
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15368 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15369 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15370 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15372 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15373 v2 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15374 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15376 v3 = *((_WORD *)v2 + 70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15377 *(_DWORD *)v2 &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15378 if ( v3 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 if ( v3 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 LABEL_48:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 v40 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386 result = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 v2 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15388 if ( (signed int)v39 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 a5 = *((_WORD *)v2 + 61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 a2 = *((_WORD *)v2 + 54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393 a1a = *((_WORD *)v2 + 53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15394 a3 = *((_WORD *)v2 + 55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 v4 = stru_5C6E00->Atan2(a1a - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396 LOWORD(v0) = *((_WORD *)v2 + 59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 v5 = *((_WORD *)v2 + 71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 v6 = ((signed int)((char *)v0 + ((signed int)stru_5C6E00->uIntegerPi >> 3) - v4 + stru_5C6E00->uIntegerPi) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 v32 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 if ( pParty->bTurnBasedModeOn )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 if ( v5 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15404 v7 = pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15405 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15408 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15410 if ( v5 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15412 v7 = pBLVRenderParams->field_0_timer_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15413 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15414 v8 = v40 + v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15415 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15418 v8 = *((_DWORD *)v2 + 37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15419 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15420 if ( *((_QWORD *)v2 + 32) > 0i64 || *((_QWORD *)v2 + 34) > 0i64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15421 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15422 v31 = *(_WORD *)&v2[2 * (signed __int16)v5 + 152];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15423 if ( *((_WORD *)v2 + 70) == 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15424 v9 = pSpriteFrameTable->GetFrameBy_x(v31, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15425 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15426 v9 = pSpriteFrameTable->GetFrame(v31, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15427 v41 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15428 v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15429 v11 = (int *)v9->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15430 if ( (unsigned __int8)v11 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15431 v41 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15432 if ( (unsigned int)v11 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15433 v41 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15434 if ( (unsigned int)v11 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15435 LOBYTE(v41) = v41 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15436 v0 = (RenderBillboard *)(256 << v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15437 if ( (unsigned int)v0 & (unsigned int)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15438 v41 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15439 if ( v10->uGlowRadius )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15441 LOBYTE(v11) = byte_4E94D3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15442 pMobileLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15443 a1a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15444 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15445 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15446 a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15447 v10->uGlowRadius,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15448 0xFFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15449 0xFFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15450 0xFFu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15451 v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15453 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15454 if ( pStru170->field_53730 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15455 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15456 while ( pStru170->pSectorIDs_toDrawDecorationsFrom[v12] != *((_WORD *)v2 + 61) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15458 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15459 if ( v12 >= pStru170->field_53730 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15460 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15462 if ( !pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(a1a, a2, a3, &x, &y, &z, 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15463 || (v0 = (RenderBillboard *)abs(x), (signed int)v0 < abs(y)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15464 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15465 pGame->pIndoorCameraD3D->Project(x, y, z, &v43, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15466 result = uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15467 v0 = &pBillboardRenderList[uNumBillboardsToDraw];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15468 if ( (signed int)uNumBillboardsToDraw >= 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15469 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15470 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15471 ++uNumSpritesDrawnThisFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15472 v13 = (Actor *)(v2 - 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15473 *(_DWORD *)v2 |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15474 v29 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15475 v0->uHwSpriteID = v10->pHwSpriteIDs[v32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15476 v0->uPalette = v10->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15477 v0->uIndoorSectorID = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15478 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15480 LODWORD(v20) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15481 HIDWORD(v20) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15482 v21 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15483 v0->field_0 = (unsigned __int64)(v10->scale * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15484 a5a = (unsigned __int64)(v10->scale * (signed __int64)v21) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15486 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15488 v14 = &pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15489 v0->flt_8 = pGame->pIndoorCameraD3D->flt_D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15490 v15 = (*v14)->flt_D4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15491 v16 = v0->flt_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15492 v0->flt_C = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15493 v17 = v16 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15494 LODWORD(v18) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15495 HIDWORD(v18) = SLOWORD(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15496 v19 = v18 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15497 v0->field_0 = (unsigned __int64)(v10->scale * v18 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15498 a5a = (unsigned __int64)(v10->scale * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15500 v0->field_4 = a5a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15501 if ( (signed __int64)v13->pActorBuffs[3].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15503 if ( (signed __int64)v13->pActorBuffs[10].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15505 a5b = (unsigned __int64)(pGame->pStru6Instance->_4A806F((Actor *)(v2 - 36)) * (signed __int64)v0->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15506 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15509 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15511 v22 = v13->pActorBuffs[3].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15512 if ( v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15514 v23 = (unsigned __int64)(65536 / (unsigned __int16)v22 * (signed __int64)v0->field_0) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15515 v24 = *((_WORD *)v2 + 116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15516 v0->field_0 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15517 a5b = (unsigned __int64)(65536 / v24 * (signed __int64)v0->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15518 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15519 v0->field_4 = a5b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15520 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15523 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15524 HIWORD(v25) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15525 v0->field_20 = a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15526 v0->field_22 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15527 v0->field_24 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15528 v0->field_26 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15529 v0->field_28 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15530 LOWORD(v25) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15531 LOBYTE(v26) = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15532 v0->sZValue = v25 + (8 * v39 | 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15533 v27 = pMonsterList->pMonsters;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15534 v28 = *((_WORD *)v2 + 30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15535 v29 = *((_DWORD *)v2 + 65) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15536 v30 = *((_DWORD *)v2 + 65) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15537 v0->field_1E = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15538 v0->pSpriteFrame = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15539 v0->field_2C_prolly_tint = *((_DWORD *)&v27[v28] - 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15540 if ( !v30 && (!(v30 | v29) || *((_DWORD *)v2 + 64)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15542 HIBYTE(v26) = HIBYTE(v41) | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15543 v0->field_1E = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15545 goto LABEL_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15547 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15549
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15550
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15551
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15552
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15553
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15554 //----- (00444732) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15555 char *_444732_GetEventHintString(unsigned int uEventID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15557 signed int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15558 char *v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15559 int v3; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15560 int v4; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15561 char *result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15562 int v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15563 char *i; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15564 int v8; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15565
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15566 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15567 if ( (signed int)uLevelEVT_NumEvents <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15569 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15570 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15572 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15574 v2 = (char *)&pLevelEVT_Events[0].uEventOffsetInEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15575 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15577 if ( *((int *)v2 - 2) == uEventID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15579 v3 = *(int *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15580 v4 = *((int *)v2 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15581 if ( pLevelEVT[*(int *)v2 + 4] == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15582 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15584 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15585 v2 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15586 if ( v1 >= (signed int)uLevelEVT_NumEvents )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15587 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15589 if ( pLevelEVT[v4 + 4] == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15591 v6 = (unsigned __int8)pLevelEVT[v4 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15592 + (((unsigned __int8)pLevelEVT[v4 + 6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 + (((unsigned __int8)pLevelEVT[v4 + 7] + ((unsigned __int8)pLevelEVT[v4 + 8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 //result = (char *)p2DEvents_minus1_::04[13 * v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15596 result = (char *)p2DEvents[v6 - 1].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15598 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15600 for ( i = (char *)pLevelEVT_Events + 4 * (3 * v1 + 3); *(int *)i == uEventID; i += 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15602 v8 = *((int *)i + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15603 if ( pLevelEVT[v8 + 4] == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15605 v6 = (unsigned __int8)pLevelEVT[v8 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15606 + (((unsigned __int8)pLevelEVT[v8 + 6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15607 + (((unsigned __int8)pLevelEVT[v8 + 7] + ((unsigned __int8)pLevelEVT[v8 + 8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15608 if ( (unsigned int)v6 < 0x258 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15609 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15612 result = &pLevelStr[pLevelStrOffsets[(unsigned __int8)pLevelEVT[v3 + 5]]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15615 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15618
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15621 //----- (00444839) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15622 unsigned int __fastcall sub_444839_move_map(unsigned int a1, int a2, int x, int y, int z, int directiony, int directionx, int a8, const char *pLocationName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15624 unsigned int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 int v10; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626 signed int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627 unsigned int v12; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628 const char *v13; // ST0C_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15629 unsigned int v14; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630 const char *v15; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15631 unsigned int v16; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15632 unsigned int result; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 const char *v18; // [sp-8h] [bp-40h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15634 const char *v19; // [sp-4h] [bp-3Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 char *v20; // [sp-4h] [bp-3Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 const char *v21; // [sp-4h] [bp-3Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637 char pContainer[40]; // [sp+Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638 unsigned int v23; // [sp+34h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15640 v9 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 v10 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15642 v23 = IndoorLocation::GetLocationIndex(pLocationName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643 dword_59117C_teleportx = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 dword_591178_teleporty = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 dword_591174_teleportz = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 dword_591170_teleport_directiony = directiony;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 dword_59116C_teleport_directionx = directionx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 dword_591168_teleport_speedz = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649 dword_591164_teleport_map_name = (char *)pLocationName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 uCurrentHouse_Animation = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15651 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15653 v11 = const_2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 sprintfex(pContainer, "evt%02d", v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 if ( pParty->uAlignment )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15657 if ( pParty->uAlignment != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659 v19 = "-c";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15663 v19 = "-b";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 strcat(pContainer, v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667 v12 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 v13 = pHouse_ExitPictures[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 pTexture_outside = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v13, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674 //pVideoPlayer->_4BF28F(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675 pVideoPlayer->_4BF28F(pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].field_0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 if ( !v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681 v14 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 v20 = pMapStats->pInfos[v14].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 v18 = pGlobalTXT_LocalizationStrings[410];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 sprintfex(byte_591098, v18, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690 v21 = pGlobalTXT_LocalizationStrings[79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 v15 = pLocationName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 if ( *pLocationName == 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696 v15 = pCurrentMapName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 v16 = pMapStats->GetMapInfo(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700 v20 = pMapStats->pInfos[v16].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 v18 = pGlobalTXT_LocalizationStrings[411];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 v21 = pGlobalTXT_LocalizationStrings[73];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 strcpy(byte_591098, v21);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 LABEL_20:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15708 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)26, 0, (int)byte_591098);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709 //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 if ( BYTE1(pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].field_C) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 HousePlaySomeSound(v9, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor && uActiveCharacter && pParty->uFlags & 0x30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 pPlayers[uActiveCharacter]->PlaySound(47, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 result = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 if ( v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 uCurrentHouse_Animation = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 //----- (0044606A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 int __fastcall PrepareHouse(unsigned int uHouseID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 int uExitPic; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727 __int16 uExitMapID; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 unsigned int *v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 int v7; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 int v8; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 unsigned int v9; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 unsigned int v10; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 int v11; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15735 char pContainer[36]; // [sp+Ch] [bp-54h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 int v13; // [sp+30h] [bp-30h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 int Dst[6]; // [sp+34h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 unsigned int v15; // [sp+4Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 int uAnimationID; // [sp+50h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 unsigned int *v17; // [sp+54h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15741 unsigned int v18; // [sp+58h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 int v19; // [sp+5Ch] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744 v15 = uHouseID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 v1 = 52 * uHouseID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 //uAnimationID = p2DEvents_minus1___02[26 * uHouseID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747 uAnimationID = p2DEvents[uHouseID - 1].uAnimationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 v18 = 52 * uHouseID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 memset(Dst, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 //uExitPic = *(__int16 *)((char *)p2DEvents_minus1_::2C + v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15752 uExitPic = p2DEvents[uHouseID - 1].uExitPicID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753 uNumDialogueNPCPortraits = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 uHouse_ExitPic = uExitPic;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 if ( uExitPic )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 //uExitMapID = *(__int16 *)((char *)p2DEvents_minus1_::30 + v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15758 uExitMapID = p2DEvents[uHouseID - 1]._quest_related;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 if ( uExitMapID > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 v17 = (unsigned int *)(uExitMapID - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 if ( !((unsigned __int8)(0x80u >> (signed int)v17 % 8) & pParty->_award_bits[(uExitMapID - 1) >> 3]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 uExitPic = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 uHouse_ExitPic = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769 dword_591080 = pAnimatedRooms[uAnimationID].field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770 result = dword_591080;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771 if ( dword_591080 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774 Dst[0] = dword_591080;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775 uNumDialogueNPCPortraits = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777 v19 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 if ( (signed int)pNPCStats->uNumNewNPCs > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 v6 = &pNPCStats->pNewNPCData[1].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 v17 = &pNPCStats->pNewNPCData[1].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784 if ( v6[3] == v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786 if ( !(*(char *)v6 & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788 v7 = v2++ - (result != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789 array_5913D8[v7] = (NPCData *)(v6 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 *(&v13 + v2) = *(v17 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 v1 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 if ( (*v6 & 3) != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 ++*v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 v6 += 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799 v17 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801 while ( v19 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 uNumDialogueNPCPortraits = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809 v8 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 sprintfex(pContainer, "npc%03u", Dst[v19]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 v9 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 pDialogueNPCPortraits[v8] = &pIcons_LOD->pTextures[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 result = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 while ( v19 < uNumDialogueNPCPortraits );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 uExitPic = uHouse_ExitPic;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 if ( uExitPic )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 v10 = pIcons_LOD->LoadTexture(pHouse_ExitPictures[uExitPic], TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 v11 = uNumDialogueNPCPortraits++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823 pDialogueNPCPortraits[v11] = &pIcons_LOD->pTextures[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 //result = *(__int16 *)((char *)p2DEvents_minus1_::2E + v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 result = p2DEvents[uHouseID - 1].uExitMapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 uHouse_ExitPic = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15833
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 //----- (0044622E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 bool __fastcall EnterHouse(enum HOUSE_TYPE uHouseID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15838 enum HOUSE_TYPE v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 int v2; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 unsigned int uOpenTime; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15841 int uCloseTime; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15842 unsigned int v5; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15843 int v6; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15844 signed int v7; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 signed int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 int v9; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 unsigned int v10; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 int v11; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849 unsigned int v12; // kr00_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15850 void *v13; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851 int v14; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852 Player *v15; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 signed int v16; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 unsigned int v17; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15855 signed int v18; // edi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 signed int v19; // edi@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15857 unsigned int v20; // ecx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 const char *v22; // [sp-4h] [bp-40h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15859 char pContainer[40]; // [sp+Ch] [bp-30h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 unsigned int v24; // [sp+34h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 enum HOUSE_TYPE v25; // [sp+38h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 v1 = uHouseID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 v25 = uHouseID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 GameUI_StatusBar_TimedString[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866 pStatusBarString[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15867 ShowStatusBarString(nullstring, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15869 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 uDialogueType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872 pKeyActionMap->_459ED1(3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 pKeyActionMap->ResetKeys();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 if ( v1 == 600 || v1 == 601 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876 GameOverMenu(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 v2 = 26 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 //uOpenTime = p2DEvents_minus1_::uOpenTime[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 uOpenTime = p2DEvents[v1 - 1].uOpenTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15882 //uCloseTime = p2DEvents_minus1_::uCloseTime[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 uCloseTime = p2DEvents[v1 - 1].uCloseTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884 ptr_F8B1E8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885 v24 = uOpenTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886 v5 = uCloseTime - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887 dword_F8B1E4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 dword_F8B1F4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 memset(byte_F8B1F0, 0, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 memset(byte_F8B148, 0, 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 v6 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 if ( (signed int)v5 <= (signed int)v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 if ( pParty->uCurrentHour >= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 if ( pParty->uCurrentHour < v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 v9 = v5 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906 if ( (signed int)v24 > 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908 v6 = v24 - 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 if ( v9 > 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 v9 -= 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 v8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[414], v6, aAMPMNames[v7], v9, aAMPMNames[v8]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15917 ShowStatusBarString(pTmpBuf, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15918 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 pPlayers[uActiveCharacter]->PlaySound(3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15920 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15923 if ( pParty->uCurrentHour > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926 v10 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 if ( (signed int)v25 >= 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929 v11 = pParty->field_3C._shop_ban_times[2 * v25 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930 if ( !(v11 | pParty->field_3C._shop_ban_times[2 * v25])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 || (signed __int64)__PAIR__(v11, pParty->field_3C._shop_ban_times[2 * v25]) <= (signed __int64)pParty->uTimePlayed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 pParty->field_3C._shop_ban_times[2 * v25] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934 pParty->field_3C._shop_ban_times[2 * v10 + 1] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15937 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 //uCurrentHouse_Animation = p2DEvents_minus1___02[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939 uCurrentHouse_Animation = p2DEvents[v2 / sizeof(_2devent) - 1].uAnimationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15940 dword_F8B198 = LOBYTE(pAnimatedRooms[uCurrentHouse_Animation].field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941 if ( dword_F8B198 == 20 && pParty->uFine )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 uCurrentHouse_Animation = (signed __int16)p2DEvents[186].uAnimationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 v25 = (HOUSE_TYPE)187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 v12 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 LODWORD(pParty->uTimePlayed) += 0x7620000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15947 v13 = &pParty->pPlayers[0].uNumDivineInterventionCastsThisDay;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 v14 = LOBYTE(pAnimatedRooms[(signed __int16)p2DEvents[186].uAnimationID].field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 pParty->uTimePlayed = __PAIR__(HIDWORD(pParty->uTimePlayed), v12) + 0x7620000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 dword_F8B198 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15953 *((short *)v13 - 258) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 memset(v13, 0, 4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955 v13 = (char *)v13 + 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957 while ( (signed int)v13 < (signed int)&pParty->field_871C[694] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15958 ++pParty->uNumPrisonTerms;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15959 pParty->uFine = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960 v15 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15963 v15->SetVariable(VAR_Award, 87);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966 while ( (signed int)v15 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 v10 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15969 ++pIcons_LOD->uTexturePacksCount;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970 if ( !pIcons_LOD->uNumPrevLoadedFiles )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 v16 = const_2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 sprintfex(pContainer, "evt%02d", v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 if ( pParty->uAlignment )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976 if ( pParty->uAlignment != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978 v22 = "-c";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15982 v22 = "-b";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 strcat(pContainer, v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986 v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 uTextureID_507B04 = uTextureID_right_panel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 PrepareHouse(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 v18 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 uTextureID_507B04 = uTextureID_right_panel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993 if ( uNumDialogueNPCPortraits == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 array_5913D8[6] = (NPCData *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 if ( (signed int)v10 < 139 || (signed int)v10 > 172 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 if ( (signed int)v10 >= 54 && (signed int)v10 <= 73 && !sub_4B68EA(v10 - 54) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000 v20 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 v19 = word_4F0704[2 * v10] - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 v20 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 if ( !((unsigned __int8)(0x80u >> v19 % 8) & pPlayers[uActiveCharacter]->field_152[v19 >> 3]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008 HousePlaySomeSound(v10, 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009 v18 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 LABEL_49:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011 dword_5C35D4 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 return v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 v18 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 HousePlaySomeSound(v20, v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 goto LABEL_49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 }