annotate mm7_3.cpp @ 0:8b8875f5b359

Initial commit
author Nomad
date Fri, 05 Oct 2012 16:07:14 +0200
parents
children ac0fb48cd27a
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "MapInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include "Game.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "GUIWindow.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "GUIFont.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "GUIButton.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "GUIProgressBar.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "AudioPlayer.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "Outdoor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "IndoorCamera.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "Overlays.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 #include "Monsters.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 #include "Arcomage.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 #include "Actor.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 #include "Allocator.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 #include "Events.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 #include "Viewport.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 #include "FrameTableInc.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 #include "Math.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 #include "LayingItem.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 #include "ObjectList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 #include "Chest.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 #include "PaletteManager.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 #include "DecorationList.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 #include "SaveLoad.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 #include "stru123.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 #include "stru287.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 #include "Time.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 #include "IconFrameTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 #include "TurnEngine.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 #include "Awards.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 #include "Autonotes.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 #include "stru160.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 #include "stru279.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 #include "Weather.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 #include "stru220.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 #include "Events2D.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 #include "stru176.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 #include "stru159.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 #include "stru298.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 //----- (0046E44E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 int __thiscall _46E44E_collide_against_faces_and_portals(unsigned int b1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 BLVSector *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 BLVFace *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 __int16 v4; // si@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 int v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 unsigned __int8 v6; // sf@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 unsigned __int8 v7; // of@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 int result; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 BLVSector *v9; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 int v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 int v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 BLVFace *v12; // ebp@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 int v13; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 int v14; // esi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 int v16; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 int v17; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 unsigned int v18; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 int v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 int v20; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 int v21; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 int v22; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 int v23; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 unsigned int v24; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 int a3; // [sp+10h] [bp-48h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 int v26; // [sp+14h] [bp-44h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 int i; // [sp+18h] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 int a10; // [sp+1Ch] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 int v29; // [sp+20h] [bp-38h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 int v30; // [sp+24h] [bp-34h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 int v31; // [sp+28h] [bp-30h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 int v32; // [sp+2Ch] [bp-2Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 int v33[10]; // [sp+30h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 v1 = &pIndoor->pSectors[stru_721530.uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 a10 = b1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 v33[0] = stru_721530.uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 for ( i = 1; v2 < v1->uNumPortals; ++v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 v3 = &pIndoor->pFaces[v1->pPortals[v2]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 if ( stru_721530.sMaxX <= v3->pBounding.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 && stru_721530.sMinX >= v3->pBounding.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 && stru_721530.sMaxY <= v3->pBounding.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 && stru_721530.sMinY >= v3->pBounding.y1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 && stru_721530.sMaxZ <= v3->pBounding.z2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 && stru_721530.sMinZ >= v3->pBounding.z1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 && abs((v3->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 + stru_721530.normal.x * v3->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 + stru_721530.normal.y * v3->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 + stru_721530.normal.z * v3->pFacePlane_old.vNormal.z) >> 16) <= stru_721530.field_6C + 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 v4 = v3->uSectorID == stru_721530.uSectorID ? v3->uBackSectorID : v3->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 v5 = i++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 v7 = __OFSUB__(i, 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 v6 = i - 10 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 v33[v5] = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 if ( !(v6 ^ v7) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 if ( i > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 v9 = &pIndoor->pSectors[v33[result]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 v32 = v9->field_4 + v9->field_C + v9->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 if ( v32 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 result = v29++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 if ( v29 >= i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 v11 = v9->pFloors[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 v12 = &pIndoor->pFaces[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 if ( v12->uAttributes & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 || stru_721530.sMaxX > v12->pBounding.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 || stru_721530.sMinX < v12->pBounding.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 || stru_721530.sMaxY > v12->pBounding.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 || stru_721530.sMinY < v12->pBounding.y1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 || stru_721530.sMaxZ > v12->pBounding.z2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 || stru_721530.sMinZ < v12->pBounding.z1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 || v11 == stru_721530.field_84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 v13 = v12->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 v14 = v12->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 v31 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 v15 = (stru_721530.normal.x * v12->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 + v14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 + stru_721530.normal.y * v13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 + stru_721530.normal.z * v12->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 v16 = (stru_721530.normal2.y * v31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 + v12->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 + stru_721530.normal2.z * v12->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 + stru_721530.normal2.x * v12->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 if ( v15 <= stru_721530.prolly_normal_d || v16 <= stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 if ( v16 <= v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 a3 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 if ( sub_47531C(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 stru_721530.prolly_normal_d,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 &a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 stru_721530.normal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 stru_721530.normal.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 stru_721530.normal.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 v17 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 a3 = stru_721530.field_6C + stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 if ( !sub_475D85(&stru_721530.normal, &stru_721530.field_58, &a3, v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 v17 = a3 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 a3 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 if ( v17 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 stru_721530.field_7C = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 v18 = 8 * v9->pFloors[v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 LOBYTE(v18) = v18 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 stru_721530.uFaceID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 if ( !(stru_721530.field_0 & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 || (v19 = v12->pFacePlane_old.vNormal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 v20 = v12->pFacePlane_old.vNormal.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 v30 = v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 v21 = (stru_721530.field_34.x * v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 + v12->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 + stru_721530.field_34.y * v20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 + stru_721530.field_34.z * v12->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 v21 <= 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 || (v22 = (stru_721530.field_4C * v30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 + v12->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 + stru_721530.field_50 * v20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 + stru_721530.field_54 * v12->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 v21 > stru_721530.prolly_normal_d)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 && v22 > stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 || v22 > v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 a3 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 if ( sub_47531C(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 stru_721530.field_8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 &a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 stru_721530.field_34.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 stru_721530.field_34.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 stru_721530.field_34.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 v23 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 a3 = stru_721530.field_6C + stru_721530.field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 if ( sub_475D85(&stru_721530.field_34, &stru_721530.field_58, &a3, v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 v23 = a3 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 a3 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 if ( v23 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 stru_721530.field_7C = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 v24 = 8 * v9->pFloors[v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 LOBYTE(v24) = v24 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 stru_721530.uFaceID = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 v10 = v26++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 if ( v26 >= v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 // 46E44E: using guessed type int var_28[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 //----- (0046E889) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 int __fastcall _46E889_collide_against_bmodels(unsigned int ecx0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 BSPModel *v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 int v3; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 ODMFace *v4; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 int v5; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 int v6; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 unsigned int v7; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 int v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 int v9; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 int v10; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 int v11; // ST18_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 int v12; // ST1C_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 int v13; // ST0C_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 unsigned int v14; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 int v15; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 int v16; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 unsigned int v17; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 int v18; // ST18_4@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 int v19; // ST1C_4@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 int v20; // ST0C_4@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 int v21; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 unsigned int v22; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 //BLVFace f; // [sp+Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 int v24; // [sp+6Ch] [bp-1Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 int a11; // [sp+70h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 unsigned int v26; // [sp+74h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 unsigned int v27; // [sp+78h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 BSPModel *v28; // [sp+7Ch] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 int a10; // [sp+80h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 int a2; // [sp+84h] [bp-4h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 a11 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 BLVFace f; // [sp+Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 //BLVFace::BLVFace(&f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 a10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 v2 = &pOutdoor->pBModels[v26 / 0xBC];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 v28 = &pOutdoor->pBModels[v26 / 0xBC];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 if ( stru_721530.sMaxX <= pOutdoor->pBModels[v26 / 0xBC].sMaxX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 if ( stru_721530.sMinX >= v2->sMinX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 if ( stru_721530.sMaxY <= v2->sMaxY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 if ( stru_721530.sMinY >= v2->sMinY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 if ( stru_721530.sMaxZ <= v2->sMaxZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 if ( stru_721530.sMinZ >= v2->sMinZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 v24 = v2->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 if ( v24 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 ++a10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 v26 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 result = a10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 if ( a10 >= (signed int)pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 v4 = &v2->pFaces[v27 / 0x134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 if ( stru_721530.sMaxX > v4->pBoundingBox.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 || stru_721530.sMinX < v4->pBoundingBox.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 || stru_721530.sMaxY > v4->pBoundingBox.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 || stru_721530.sMinY < v4->pBoundingBox.y1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 || stru_721530.sMaxZ > v4->pBoundingBox.z2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 || stru_721530.sMinZ < v4->pBoundingBox.z1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 f.pFacePlane_old.vNormal.x = v4->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 f.pFacePlane_old.vNormal.y = v4->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 v5 = v4->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 f.pFacePlane_old.vNormal.z = v4->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 v6 = v4->pFacePlane.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 f.pFacePlane_old.dist = v4->pFacePlane.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 v7 = v4->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 f.uAttributes = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 f.pBounding.x1 = v4->pBoundingBox.x1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 f.pBounding.y1 = v4->pBoundingBox.y1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 f.pBounding.z1 = v4->pBoundingBox.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 f.pBounding.x2 = v4->pBoundingBox.x2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 f.pBounding.y2 = v4->pBoundingBox.y2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 f.pBounding.z2 = v4->pBoundingBox.z2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 f.zCalc1 = v4->zCalc1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 f.zCalc2 = v4->zCalc2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 f.zCalc3 = v4->zCalc3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 f.pXInterceptDisplacements = v4->pXInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 f.pYInterceptDisplacements = v4->pYInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 f.pZInterceptDisplacements = v4->pZInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 f.uPolygonType = (PolygonType)v4->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 f.uNumVertices = v4->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 f.uBitmapID = v4->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 f.pVertexIDs = v4->pVertexIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 if ( !(v7 & 0x20000000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 if ( !(v7 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 v2 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 v27 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 if ( v3 >= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 v8 = (v5 * stru_721530.normal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 + v6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 + f.pFacePlane_old.vNormal.y * stru_721530.normal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 + f.pFacePlane_old.vNormal.x * stru_721530.normal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 v9 = (v5 * stru_721530.normal2.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 + v6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 + f.pFacePlane_old.vNormal.y * stru_721530.normal2.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 + f.pFacePlane_old.vNormal.x * stru_721530.normal2.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 if ( v8 <= stru_721530.prolly_normal_d || v9 <= stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 if ( v9 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 a2 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 if ( sub_4754BF(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 stru_721530.prolly_normal_d,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 stru_721530.normal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 stru_721530.normal.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 stru_721530.normal.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 a11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 v10 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 v11 = stru_721530.field_58.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 v12 = stru_721530.field_58.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 v13 = stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 a2 = stru_721530.prolly_normal_d + stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 if ( !sub_475F30(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 stru_721530.normal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 v13,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 stru_721530.normal.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 v10 = a2 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 a2 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 if ( v10 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 stru_721530.field_7C = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 v14 = 8 * (v3 | (a10 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 LOBYTE(v14) = v14 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 stru_721530.uFaceID = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 if ( stru_721530.field_0 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 v15 = (f.pFacePlane_old.vNormal.z * stru_721530.field_34.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 + f.pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 + f.pFacePlane_old.vNormal.y * stru_721530.field_34.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 + f.pFacePlane_old.vNormal.x * stru_721530.field_34.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 v16 = (f.pFacePlane_old.vNormal.z * stru_721530.field_54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 + f.pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 + f.pFacePlane_old.vNormal.y * stru_721530.field_50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 + f.pFacePlane_old.vNormal.x * stru_721530.field_4C) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 if ( v15 <= stru_721530.prolly_normal_d || v16 <= stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 if ( v16 <= v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 a2 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 if ( sub_4754BF(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 stru_721530.field_8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 stru_721530.field_34.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 stru_721530.field_34.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 stru_721530.field_34.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 a11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 if ( a2 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 stru_721530.field_7C = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 v17 = 8 * (v3 | (a10 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 LOBYTE(v17) = v17 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 stru_721530.uFaceID = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 v18 = stru_721530.field_58.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 v19 = stru_721530.field_58.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 v20 = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 a2 = stru_721530.field_6C + stru_721530.field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 if ( sub_475F30(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 stru_721530.field_34.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 v20,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 stru_721530.field_34.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 v18,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 v2 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 v21 = a2 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 a2 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 if ( a2 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 stru_721530.field_7C = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 v22 = 8 * (v3 | (a10 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 LOBYTE(v22) = v22 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 stru_721530.uFaceID = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 //----- (0046ED1B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 int __fastcall _46ED1B_collide_against_floor(signed int a1, signed int a2, int a3, unsigned int *pSectorID, int *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 unsigned int *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 int v8; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 int v9; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 v5 = pSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 v8 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 result = _46CEC3_get_floor_level(a1, a2, a3, *pSectorID, (int *)&pSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 if ( result != -30000 && result <= a3 + 50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 || (v7 = pIndoor->GetSector(v8, v9, a3), (*v5 = v7) != 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 && (result = _46CEC3_get_floor_level(v8, v9, a3, v7, (int *)&pSectorID), result != -30000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 *a5 = (int)pSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 result = -30000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 //----- (0046ED8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 void __fastcall _46ED8A_collide_against_layingItems(unsigned int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 int v1; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 ObjectDesc *v2; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 int v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 int v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 int v6; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 int v8; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 int v9; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 int v10; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 int v11; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 signed int v12; // [sp+0h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 int v13; // [sp+4h] [bp-10h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 char *v14; // [sp+8h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 unsigned int v15; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 v12 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 v1 = (int)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 v14 = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 if ( *(short *)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 v2 = &pObjectList->pObjects[*(short *)v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 if ( !(v2->uFlags & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 v3 = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 v4 = *(int *)(v1 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 if ( stru_721530.sMaxX <= v4 + v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 if ( stru_721530.sMinX >= v4 - v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 v5 = *(int *)(v1 + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 if ( stru_721530.sMaxY <= v5 + v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 if ( stru_721530.sMinY >= v5 - v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 v6 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 v7 = *(int *)(v1 + 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 v13 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 if ( stru_721530.sMaxZ <= v7 + v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 if ( stru_721530.sMinZ >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 v8 = v4 - stru_721530.normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 v9 = v5 - stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 if ( abs(((v4 - stru_721530.normal.x) * stru_721530.field_58.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 - (v5 - stru_721530.normal.y) * stru_721530.field_58.x) >> 16) <= v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 + stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 v10 = (v8 * stru_721530.field_58.x + v9 * stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 if ( v10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 v11 = stru_721530.normal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 + ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 if ( v11 >= *(int *)(v14 + 10) - stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 if ( v11 <= v13 + stru_721530.prolly_normal_d + *(int *)(v14 + 10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 if ( v10 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 sub_46DEF2(v12, v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 v1 = (int)(v14 + 112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 v14 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 while ( (signed int)v15 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 //----- (0046EF01) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 int __thiscall _46EF01_collision_chech_player(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 int v3; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 int v4; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 int v5; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 int v7; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 int v8; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 unsigned int v9; // [sp+10h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 int v10; // [sp+14h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 int v11; // [sp+18h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 v8 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 v1 = 2 * pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 result = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 v9 = pParty->uPartyHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 if ( stru_721530.sMaxX <= pParty->vPosition.x + 2 * pParty->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 if ( stru_721530.sMinX >= pParty->vPosition.x - v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 if ( stru_721530.sMaxY <= pParty->vPosition.z + v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 if ( stru_721530.sMinY >= pParty->vPosition.z - v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 if ( stru_721530.sMaxZ <= (signed int)(pParty->vPosition.y + pParty->uPartyHeight) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 if ( stru_721530.sMinZ >= pParty->vPosition.y )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 v3 = stru_721530.prolly_normal_d + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 v11 = pParty->vPosition.x - stru_721530.normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 v4 = ((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 - (pParty->vPosition.z - stru_721530.normal.y) * stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 v10 = pParty->vPosition.z - stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 result = abs(((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 - (pParty->vPosition.z - stru_721530.normal.y) * stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 if ( result <= v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 result = v10 * stru_721530.field_58.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 v5 = (v10 * stru_721530.field_58.y + v11 * stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 if ( v5 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 v6 = ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v5) >> 16) + stru_721530.normal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 result = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 if ( v6 >= pParty->vPosition.y )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 result = v9 + pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 if ( v6 <= (signed int)(v9 + pParty->vPosition.y) || v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 result = sub_452A9E(v3 * v3 - v4 * v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 v7 = v5 - result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 if ( v7 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 if ( v7 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 stru_721530.field_7C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 stru_721530.uFaceID = 4;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 //----- (0046F04E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 signed int __cdecl _46F04E_collide_against_portals()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 BLVSector *v0; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 unsigned int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 BLVFace *v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 int v4; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 int v5; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 signed int result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 BLVFace *v7; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 signed int v8; // [sp+0h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 BLVSector *v9; // [sp+4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 unsigned int v10; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 int a3; // [sp+Ch] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 int v12; // [sp+10h] [bp-4h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 v0 = &pIndoor->pSectors[stru_721530.uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 v1 = 0xFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 v10 = 0xFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 v9 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 if ( v0->uNumPortals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 v2 = v0->pPortals[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 if ( v2 != stru_721530.field_80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 v3 = &pIndoor->pFaces[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 if ( stru_721530.sMaxX <= v3->pBounding.x2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 if ( stru_721530.sMinX >= v3->pBounding.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 && stru_721530.sMaxY <= v3->pBounding.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 && stru_721530.sMinY >= v3->pBounding.y1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 && stru_721530.sMaxZ <= v3->pBounding.z2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 && stru_721530.sMinZ >= v3->pBounding.z1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 v4 = (stru_721530.normal.x * v3->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 + v3->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 + stru_721530.normal.y * v3->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 + stru_721530.normal.z * v3->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 v5 = (stru_721530.normal2.z * v3->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 + v3->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 + stru_721530.normal2.x * v3->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 + stru_721530.normal2.y * v3->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 if ( (v4 < stru_721530.prolly_normal_d || v5 < stru_721530.prolly_normal_d)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 && (v4 > -stru_721530.prolly_normal_d || v5 > -stru_721530.prolly_normal_d)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 && (a3 = stru_721530.field_6C, sub_475D85(&stru_721530.normal, &stru_721530.field_58, &a3, v3))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 && a3 < (signed int)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 v0 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 v10 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 v12 = v9->pPortals[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 v0 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 while ( v8 < v0->uNumPortals );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 v1 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 if ( stru_721530.field_7C >= (signed int)v1 && (signed int)v1 <= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 stru_721530.field_80 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 v7 = &pIndoor->pFaces[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 if ( v7->uSectorID == stru_721530.uSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 stru_721530.uSectorID = v7->uBackSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 stru_721530.uSectorID = v7->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 stru_721530.field_7C = 268435455;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 //----- (0046F228) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 void __cdecl BLV_UpdateDoors()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 int v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 BLVDoor *v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 unsigned __int16 v3; // ax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 unsigned int v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 int v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 int v7; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 unsigned __int8 v9; // zf@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 char v10; // sf@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 unsigned __int8 v11; // of@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 int v12; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 int v13; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 __int16 v14; // ax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 BLVFace *v15; // ebx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 unsigned __int16 *v16; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 Vec3_short_ *v17; // esi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 int v18; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 int v19; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 signed int v20; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 Vec3_short_ *v21; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 double v22; // st7@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 double v23; // st6@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 int v24; // esi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 int v25; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 BLVDoor *v26; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 signed __int64 v27; // qtt@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 BLVFaceExtra *v28; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 int v29; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 int v30; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 unsigned __int64 v31; // qax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 int v32; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 unsigned __int16 *v33; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 Vec3_short_ *v34; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 int v35; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 int v36; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 signed int v37; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 signed int v38; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 int v39; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 int v40; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 unsigned __int8 v41; // cf@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 unsigned __int16 *v42; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 Vec3_short_ *v43; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 int v44; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 int v45; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 int v46; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 unsigned __int16 *v47; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 int v48; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 unsigned int v49; // ecx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 unsigned __int16 v50; // ax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 unsigned int v51; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 unsigned __int16 v52; // ax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 int v53; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 int v54; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 unsigned __int64 v55; // qax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 int v56; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 int v57; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 int v58; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 SoundID v59; // [sp-24h] [bp-88h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 signed int v60; // [sp-20h] [bp-84h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 unsigned int v61; // [sp-1Ch] [bp-80h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 signed int v62; // [sp-18h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 signed int v63; // [sp-14h] [bp-78h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 int v64; // [sp-10h] [bp-74h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 unsigned int v65; // [sp-Ch] [bp-70h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 int v66; // [sp-8h] [bp-6Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 int v67; // [sp+8h] [bp-5Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 int v68; // [sp+Ch] [bp-58h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 int v69; // [sp+10h] [bp-54h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 int v70; // [sp+14h] [bp-50h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 int v71; // [sp+18h] [bp-4Ch]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 int v72; // [sp+1Ch] [bp-48h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 int v73; // [sp+20h] [bp-44h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 __int16 v74; // [sp+24h] [bp-40h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 int v75; // [sp+28h] [bp-3Ch]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 int v76; // [sp+2Ch] [bp-38h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 int v77; // [sp+30h] [bp-34h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 int v78; // [sp+34h] [bp-30h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 int v79; // [sp+38h] [bp-2Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 unsigned int v80; // [sp+3Ch] [bp-28h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 int v81; // [sp+40h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 int v82; // [sp+44h] [bp-20h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 int v83; // [sp+48h] [bp-1Ch]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 int v84; // [sp+4Ch] [bp-18h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 int v85; // [sp+50h] [bp-14h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 SoundID eDoorSoundID; // [sp+54h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 BLVDoor *v87; // [sp+58h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 int v88; // [sp+5Ch] [bp-8h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 int v89; // [sp+60h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 eDoorSoundID = (SoundID)pDoorSoundIDsByLocationID[dword_6BE13C_uCurrentlyLoadedLocationID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 if ( pIndoor->uNumDoors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 v80 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 v2 = &pIndoor->pDoors[v80 / 0x50];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 v87 = &pIndoor->pDoors[v80 / 0x50];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 v3 = pIndoor->pDoors[v80 / 0x50].uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 if ( v3 == (short)v0 || v3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 v2->uAttributes &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 goto LABEL_62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 v2->uTimeSinceTriggered += pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 v4 = v2->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 if ( v2->uState == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 v89 = (signed int)(v4 * v2->uCloseSpeed) / 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 if ( v89 >= v2->uMoveLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 v89 = v2->uMoveLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 v2->uState = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 if ( !(v2->uAttributes & 6) && v2->uNumVertices != (short)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 v66 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 v65 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 v64 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 v7 = 8 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 v63 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 v62 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 LOBYTE(v7) = 8 * v1 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 v61 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 v60 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 v59 = (SoundID)((int)eDoorSoundID + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 pAudioPlayer->PlaySound(v59, v60, v61, v62, v63, v64, v65, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 v5 = (signed int)(v4 * v2->uOpenSpeed) / 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 v6 = v2->uMoveLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 if ( v5 >= v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 v89 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 v2->uState = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 v89 = v6 - v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 if ( !(v2->uAttributes & 6) && v2->uNumVertices != (short)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 v66 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 v65 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 v64 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 v8 = 8 * v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 v63 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 v62 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 LOBYTE(v8) = 8 * v1 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 v61 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 v60 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 v59 = eDoorSoundID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 v11 = __OFSUB__(v2->uNumVertices, (short)v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 v9 = v2->uNumVertices == (short)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 v10 = (signed __int16)(v2->uNumVertices - v0) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 v88 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 v12 = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 v13 = v2->pVertexIDs[v88];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 v85 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 v79 = v2->vDirection.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 v85 = (unsigned __int64)(v79 * (signed __int64)v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 v13 *= 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 *(__int16 *)((char *)&pIndoor->pVertices->x + v13) = ((unsigned int)(v79 * v89) >> 16) + v2->pXOffsets[v88];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 v85 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 v79 = v2->vDirection.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 v85 = (unsigned __int64)(v79 * (signed __int64)v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 *(__int16 *)((char *)&pIndoor->pVertices->y + v13) = ((unsigned int)(v79 * v89) >> 16) + v2->pYOffsets[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 v85 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 v79 = v2->vDirection.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 v85 = (unsigned __int64)(v79 * (signed __int64)v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 v14 = ((unsigned int)(v79 * v89) >> 16) + v2->pZOffsets[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 ++v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 *(__int16 *)((char *)&pIndoor->pVertices->z + v13) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 while ( v88 < v2->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 v1 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 v11 = __OFSUB__(v2->uNumFaces, (short)v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 v9 = v2->uNumFaces == (short)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 v10 = (signed __int16)(v2->uNumFaces - v0) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 v88 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 v15 = &pIndoor->pFaces[v2->pFaceIDs[v88]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 v16 = v15->pVertexIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 v17 = &pIndoor->pVertices[*v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 v18 = v15->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 v73 = *(int *)&v17->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 v74 = v17->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 v19 = v15->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 v20 = -(v19 * v74 + (signed __int16)v73 * v15->pFacePlane_old.vNormal.x + SHIWORD(v73) * v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 v15->pFacePlane_old.dist = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 v21 = &pIndoor->pVertices[*v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 v79 = v21->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 v22 = (double)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 v23 = (double)v21->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 v79 = v21->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 v15->pFacePlane.dist = -((double)v79 * v15->pFacePlane.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 + v23 * v15->pFacePlane.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 + v22 * v15->pFacePlane.vNormal.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 v24 = abs(v20 >> 15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 v25 = abs(v15->pFacePlane_old.vNormal.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 v26 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 if ( v24 > v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 Abortf(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 "Door Error\ndoor id: %i\nfacet no: %i\n\nOverflow dividing facet->d [%i] by facet->nz [%i]",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 v87->uDoorID,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 v87->pFaceIDs[v88],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 v15->pFacePlane_old.dist,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 v15->pFacePlane_old.vNormal.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 v79 = v15->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 v85 = v15->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 LODWORD(v27) = v85 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 HIDWORD(v27) = v85 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 v85 = v27 / v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 v15->zCalc3 = -(v27 / v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 v26 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 if ( BYTE2(v15->uAttributes) & 4 || pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 v15->_get_normals((Vec3_int_ *)&v70, (Vec3_int_ *)&v67);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 v28 = &pIndoor->pFaceExtras[v15->uFaceExtraID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 if ( !(BYTE2(v15->uAttributes) & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 v79 = v26->vDirection.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 v83 = (unsigned __int64)(v79 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 v85 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 v79 = v26->vDirection.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 v85 = (unsigned __int64)(v79 * (signed __int64)v71) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 v84 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 v79 = v26->vDirection.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 v84 = (unsigned __int64)(v79 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 v79 = v83 + v85 + ((unsigned __int64)(v79 * (signed __int64)v72) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 v29 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 v83 = (unsigned __int64)(v79 * (signed __int64)v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 v28->sTextureDeltaU = -((unsigned int)(v79 * v89) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 v79 = v26->vDirection.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 v85 = (unsigned __int64)(v79 * (signed __int64)v67) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 v83 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 v79 = v26->vDirection.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 v83 = (unsigned __int64)(v79 * (signed __int64)v68) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 v84 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 v79 = v26->vDirection.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 v84 = (unsigned __int64)(v79 * (signed __int64)v69) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 v30 = v83 + ((unsigned __int64)(v79 * (signed __int64)v69) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 v79 = v85 + v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 v31 = (v85 + v30) * (signed __int64)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 v83 = v31 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 v32 = v31 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 v28->sTextureDeltaU = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 v28->sTextureDeltaV = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 v33 = v15->pVertexIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 v85 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 v34 = &pIndoor->pVertices[*v33];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 v35 = v34->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 v36 = v34->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 v82 = v34->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 v79 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 v37 = v70 * v82 + v71 * v36 + v72 * v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 v38 = v67 * v82 + v68 * v36 + v35 * v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 v39 = v37 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 *v15->pVertexUIDs = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 v40 = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 *v15->pVertexVIDs = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 v41 = v15->uNumVertices < 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 v9 = v15->uNumVertices == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 v83 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 v84 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 v82 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 if ( !(v41 | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 v42 = v15->pVertexIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 v75 = 2 * v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 v43 = &pIndoor->pVertices[v42[v85]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 v79 = v43->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 v44 = v43->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 v45 = v43->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 v78 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 v76 = (v72 * v79 + v70 * v45 + v71 * v44) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 v46 = (v67 * v45 + v68 * v44 + v79 * v69) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 v77 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 if ( v76 < v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 v39 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 if ( v46 < v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 v83 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 if ( v76 > v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 v84 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 if ( v46 > v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 v82 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 v47 = v15->pVertexUIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 v48 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 ++v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 *(unsigned __int16 *)((char *)v47 + v75) = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 *(unsigned __int16 *)((char *)v15->pVertexVIDs + v48) = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 v40 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 while ( v85 < v15->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 v26 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 v49 = v15->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 if ( BYTE1(v49) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 if ( SBYTE1(v49) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 v50 = v15->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 if ( v50 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 v51 = v15->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 if ( v51 & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 v28->sTextureDeltaV -= v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 if ( v51 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 v52 = v15->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 if ( v52 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 v28->sTextureDeltaV -= v82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 + *(short *)((signed __int16)v52 != -1 ? 72 * (signed __int16)v52 + 7278780 + 0x1A : 26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 if ( BYTE2(v15->uAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 v75 = v26->vDirection.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 v84 = (unsigned __int64)(v75 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 v82 = v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 v75 = v26->vDirection.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 v82 = (unsigned __int64)(v75 * (signed __int64)v71) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 v83 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 v75 = v26->vDirection.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 v83 = (unsigned __int64)(v75 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 v75 = v84 + v82 + ((unsigned __int64)(v75 * (signed __int64)v72) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 v53 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 v82 = (unsigned __int64)(v75 * (signed __int64)v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 v28->sTextureDeltaU = -((unsigned int)(v75 * v89) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 v75 = v26->vDirection.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 v84 = (unsigned __int64)(v75 * (signed __int64)v67) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 v82 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 v75 = v26->vDirection.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 v82 = (unsigned __int64)(v75 * (signed __int64)v68) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 v83 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 v75 = v26->vDirection.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 v83 = (unsigned __int64)(v75 * (signed __int64)v69) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 v54 = v82 + ((unsigned __int64)(v75 * (signed __int64)v69) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 v75 = v84 + v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 v55 = (v84 + v54) * (signed __int64)v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 v82 = v55 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 v32 = v55 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 v56 = v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 v57 = -v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 v28->sTextureDeltaV = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 v28->sTextureDeltaU += v26->pDeltaUs[v56];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 v28->sTextureDeltaV = v57 + v26->pDeltaVs[v56];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 v58 = v26->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 ++v88;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 if ( v88 >= v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 v1 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 goto LABEL_62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 v2 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 LOWORD(v39) = v84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 + ((signed __int16)v39 != -1 ? pBitmaps_LOD->pTextures[(signed __int16)v39].uTextureWidth : 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 v28->sTextureDeltaU -= v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 LABEL_62:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 v80 += 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 v81 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 while ( v1 < pIndoor->uNumDoors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 // 6BE13C: using guessed type int dword_6BE13C_uCurrentlyLoadedLocationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 //----- (0046F90C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 void __cdecl UpdateActors_BLV()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 Actor *v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 unsigned __int16 v1; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 int v2; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 int v3; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 int v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 __int16 v5; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 signed int v6; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 unsigned __int8 v7; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 unsigned __int8 v8; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 signed __int16 v9; // ax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 signed __int64 v10; // qax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 unsigned __int16 v11; // ax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 int v12; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 unsigned __int64 v13; // qax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 int v14; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 unsigned __int64 v15; // qax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 int v16; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 BLVFace *v17; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 int v18; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 BLVFace *v19; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 int v20; // ecx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 int v21; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 int v22; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 int v23; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 unsigned int v24; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 int v25; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 int v26; // ebx@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 int v27; // ST08_4@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 int v28; // edi@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 int v29; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 int v30; // ecx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 int v31; // ebx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 int v32; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 int v33; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239 unsigned int v34; // ecx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 int v35; // ecx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 signed int v36; // edx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 signed int v37; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 BLVFace *v38; // edi@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 int v39; // ecx@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245 int v40; // ebx@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246 PolygonType v41; // al@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 int v42; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 __int16 v43; // dx@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 int v44; // ecx@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 int v45; // edi@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 int v46; // edi@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 int v47; // eax@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 unsigned __int64 v48; // qax@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 unsigned __int8 v49; // zf@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 unsigned __int8 v50; // sf@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 unsigned __int8 v51; // of@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 AIDirection v52; // [sp+0h] [bp-60h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 AIDirection v53; // [sp+1Ch] [bp-44h]@116
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 int v54; // [sp+38h] [bp-28h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 int v55; // [sp+3Ch] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 int v56; // [sp+40h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 unsigned int _this; // [sp+44h] [bp-1Ch]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 int v58; // [sp+48h] [bp-18h]@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 int v59; // [sp+4Ch] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 int v60; // [sp+50h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 int v61; // [sp+54h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 int v62; // [sp+58h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 unsigned int v63; // [sp+5Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 v0 = &pActors[v63];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 v1 = v0->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 if ( v1 == 11 || v1 == 19 || v1 == 17 || !v0->uMovementSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 v55 = v0->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 v2 = _46ED1B_collide_against_floor(v0->vPosition.x, v0->vPosition.y, v0->vPosition.z, (unsigned int *)&v55, &v60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 v0->uSectorID = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 v3 = v0->pMonsterInfo.uFlying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 v56 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 v62 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 if ( !v0->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 v4 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 if ( v4 > v2 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 if ( v2 <= -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 v5 = pIndoor->GetSector(v0->vPosition.x, v0->vPosition.y, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 v0->uSectorID = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 if ( !v5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 || (v56 = _46CEC3_get_floor_level(v0->vPosition.x, v0->vPosition.y, v0->vPosition.z, v5, &v60), v56 == -30000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 if ( v0->uCurrentActionAnimation == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 v6 = v0->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 v7 = HIDWORD(v0->pActorBuffs[7].uExpireTime) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 v8 = SHIDWORD(v0->pActorBuffs[7].uExpireTime) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 v61 = v0->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 if ( !v8 && (!(v8 | v7) || LODWORD(v0->pActorBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 v9 = v0->pActorBuffs[7].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 LODWORD(v10) = v6 / (unsigned __int16)v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 v10 = (signed __int64)((double)v61 * 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 v6 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 v61 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 v11 = v0->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 if ( v11 == 6 || v11 == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 v6 *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 v61 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 v6 = (signed __int64)((double)v61 * flt_6BE3AC_debug_recmod1_x_1_6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 if ( v6 > 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 v6 = 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 v12 = stru_5C6E00->SinCos(v0->uYawAngle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 v55 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 v13 = v12 * (signed __int64)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 v61 = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 v0->vVelocity.x = WORD1(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 v55 = stru_5C6E00->SinCos(v0->uYawAngle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 v61 = (unsigned __int64)(v55 * (signed __int64)v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 v7 = v62 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 v0->vVelocity.y = (unsigned int)(v55 * v6) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 v14 = stru_5C6E00->SinCos(v0->uPitchAngle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 v55 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 v15 = v14 * (signed __int64)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 v61 = v15 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 v0->vVelocity.z = WORD1(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 v61 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 v55 = 55000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 v61 = (unsigned __int64)(55000i64 * v61) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 v0->vVelocity.x = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 v61 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 v61 = (unsigned __int64)(v55 * (signed __int64)v61) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 v7 = v62 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 v0->vVelocity.y = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 v55 = 55000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 v61 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 v61 = (unsigned __int64)(55000i64 * v61) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 v0->vVelocity.z = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 v16 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 v17 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 v51 = __OFSUB__(v16, v56);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 v8 = v16 - v56 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 v18 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 if ( v8 ^ v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 v0->vPosition.z = v56 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 v19 = &v17[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 if ( v19->uPolygonType == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 if ( v0->vVelocity.z < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 v0->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 if ( v19->pFacePlane_old.vNormal.z < 45000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 v0->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 if ( v59 && !v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 v0->vVelocity.z += -8 * LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 if ( v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y + v0->vVelocity.z * v0->vVelocity.z >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 v0->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 v0->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 v0->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 if ( BYTE2(v17[v18].uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 if ( v0->uAIState == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 v0->uAIState = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 LABEL_123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 ++v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 if ( (signed int)v63 >= (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 v20 = v0->uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 v21 = v0->uActorHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 stru_721530.field_8 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 stru_721530.prolly_normal_d = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 stru_721530.field_C = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 stru_721530.field_34.x = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 stru_721530.field_34.y = v0->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 stru_721530.normal.y = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 v23 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 stru_721530.normal.z = v23 + v20 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 stru_721530.field_34.z = v23 - v20 + stru_721530.field_C - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 if ( stru_721530.field_34.z < stru_721530.normal.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 stru_721530.field_34.z = v23 + v20 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 stru_721530.field_1C = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 stru_721530.field_20 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 stru_721530.field_24 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 stru_721530.uSectorID = v0->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 if ( !stru_721530._47050A(v22) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 v58 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 v24 = 8 * v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 LOBYTE(v24) = 8 * v63 | 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 v61 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 _this = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 _46E44E_collide_against_faces_and_portals(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 _46E0B2_collide_against_decorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 _46EF01_collision_chech_player(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 _46ED8A_collide_against_layingItems(_this);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 if ( ai_arrays_size > v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 v54 = ai_array_4F7DB0_actor_ids[v25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 if ( v54 != v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 v26 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 v27 = abs(pActors[v54].vPosition.z - v0->vPosition.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 v28 = abs(pActors[v26].vPosition.y - v0->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 v29 = abs(pActors[v26].vPosition.x - v0->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 if ( sub_4621DA(v29, v28, v27) >= v0->uActorRadius + (signed int)pActors[v26].uActorRadius
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 && _46DF1A_collide_against_actor(v54, 40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 ++v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 v25 = v56++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 while ( v56 < ai_arrays_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 ++v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 while ( v61 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 v56 = v58 > 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 v30 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 v31 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 v32 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 v30 = v58 + v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 v31 = v58 + v0->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 v32 = v58 + v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 v33 = _46ED1B_collide_against_floor(v30, v31, v32, &stru_721530.uSectorID, &v60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 v34 = pIndoor->pFaces[v60].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 v35 = v34 & 0x400000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 if ( v35 && v0->uAIState == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 v0->uAIState = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 goto LABEL_120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 if ( v59 != v22 || v62 != v22 || v35 == v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 if ( v33 == -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 goto LABEL_120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 if ( v0->uCurrentActionAnimation != 1 || v33 >= v0->vPosition.z - 100 || v59 != v22 || v62 != v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 v0->vPosition.x = LOWORD(stru_721530.normal2.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 v0->vPosition.y = LOWORD(stru_721530.normal2.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 v0->vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 v0->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 v0->vPosition.x += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 v0->vPosition.y += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 v58 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 v36 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 v0->vPosition.z += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 v0->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 v37 = v36 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 if ( (v36 & 7) != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 if ( (v36 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 if ( (v36 & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 _this = sub_452A9E(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 v45 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 v0->vPosition.x - pLevelDecorations[v37].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 v0->vPosition.y - pLevelDecorations[v37].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 v54 = stru_5C6E00->SinCos(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 v56 = (unsigned __int64)(v54 * (signed __int64)(signed int)_this) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 v46 = v45 - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 v0->vVelocity.x = v54 * _this >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 v47 = stru_5C6E00->SinCos(v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 v54 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 v48 = v47 * (signed __int64)(signed int)_this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 v56 = v48 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 v0->vVelocity.y = WORD1(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 if ( (v36 & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 stru_721530.field_84 = v36 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 v38 = &pIndoor->pFaces[v37];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 if ( v38->uPolygonType == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 v39 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 v40 = v0->vVelocity.y * v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 v0->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 v0->vPosition.z = pIndoor->pVertices[*v38->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 if ( v39 * v39 + v40 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 v0->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 v0->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 v61 = abs(v38->pFacePlane_old.vNormal.x * v0->vVelocity.x + v38->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 * v0->vVelocity.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 + v38->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 * v0->vVelocity.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 if ( stru_721530.field_64 >> 3 > v61 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 v61 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 v58 = v38->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 v58 = (unsigned __int64)(v61 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 _this = v38->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 _this = (unsigned __int64)(v61 * (signed __int64)(signed int)_this) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 v56 = v38->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 v56 = (unsigned __int64)(v61 * (signed __int64)v56) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 v0->vVelocity.x += v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 v0->vVelocity.y += _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 v0->vVelocity.z += v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 v41 = v38->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 if ( v41 != 4 && v41 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 v42 = v38->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 v43 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 v44 = stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 - ((v38->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 + v38->pFacePlane_old.vNormal.z * v0->vPosition.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 + v38->pFacePlane_old.vNormal.y * v0->vPosition.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 + v42 * v0->vPosition.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 if ( v44 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 v0->vPosition.x += (unsigned int)(v44 * v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 v0->vPosition.y += (unsigned int)(v44 * v38->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 v0->vPosition.z = v43 + ((unsigned int)(v44 * v38->pFacePlane_old.vNormal.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 v0->uYawAngle = stru_5C6E00->Atan2(v0->vVelocity.x, v0->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 if ( BYTE3(v38->uAttributes) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 EventProcessor(pIndoor->pFaceExtras[v38->uFaceExtraID].uEventID, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 LABEL_119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 v56 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 v54 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 v56 = (unsigned __int64)(58500i64 * v56) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 v0->vVelocity.x = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 v56 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 v56 = (unsigned __int64)(v54 * (signed __int64)v56) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 v54 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 v0->vVelocity.y = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 v56 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 v56 = (unsigned __int64)(v54 * (signed __int64)v56) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 v0->vVelocity.z = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 goto LABEL_120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 if ( v0->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 v51 = __OFSUB__(HIDWORD(pParty->pPartyBuffs[11].uExpireTime), v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 v49 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) == v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 v50 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) - v22 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 v0->vVelocity.y = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 v0->vVelocity.x = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 if ( !(v50 ^ v51)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 && (!((unsigned __int8)(v50 ^ v51) | v49) || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > v22) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 v36 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 LABEL_118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 Actor::FaceObject(v63, v36, v22, (AIDirection *)v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 2 || pTurnEngine->field_4 == 3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 if ( v0->pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 if ( v56 == v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 if ( v56 == v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 if ( !pActors[v37].pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 LABEL_114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 Actor::_402968(v63, v36, v22, (AIDirection *)v22);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 Actor::_403F58(v63, 4, v22, &v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 if ( v0->vPosition.x & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 v0->uYawAngle += 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 v0->uYawAngle -= 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 2 || pTurnEngine->field_4 == 3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 if ( !v0->pMonsterInfo.uHostilityType || v56 != v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 Actor::_403F58(v63, 4, v22, &v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 LABEL_120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 if ( v55 >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 v20 = stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 //----- (0047050A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 int stru141::_47050A(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 stru141 *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 signed int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 int v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 int v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 signed int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 int v10; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 int v11; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 int v12; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 int v13; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 int v14; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 int v15; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 int v16; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 int v17; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 int v18; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 int v19; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 int v20; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 int v21; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 int v22; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 int v23; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 int v24; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 int v25; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 int v26; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 int v27; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 int v28; // [sp+14h] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 v3 = sub_452A9E(this->field_24 * this->field_24 + this->field_20 * this->field_20 + this->field_1C * this->field_1C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 v4 = v3 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 v5 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 v2->field_64 = v3 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 v2->field_58.x = 65536 / (v3 | 1) * v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 v2->field_58.y = 65536 / (v3 | 1) * v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 v6 = 65536 / (v3 | 1) * v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 v2->field_68 = 65536 / (v3 | 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 v2->field_58.z = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 if ( !a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 v7 = pEventTimer->dt_in_some_format;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 v8 = ((unsigned __int64)(v7 * (signed __int64)v4) >> 16) - v2->field_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 v2->field_6C = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 v10 = ((unsigned __int64)(v8 * (signed __int64)v2->field_58.x) >> 16) + v2->normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 v2->field_4C = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 v2->normal2.x = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 v11 = ((unsigned __int64)(v2->field_6C * (signed __int64)v2->field_58.y) >> 16) + v2->normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 v2->field_50 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 v2->normal2.y = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 v2->normal2.z = ((unsigned __int64)(v2->field_6C * (signed __int64)v2->field_58.z) >> 16) + v2->normal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 v12 = v2->field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 v13 = v2->normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 v14 = v2->normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 v15 = v2->prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 v16 = v12 + ((unsigned __int64)(v2->field_6C * (signed __int64)v2->field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 v28 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 v2->field_54 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736 v17 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 if ( v13 >= v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 v17 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 v2->sMaxX = v17 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 v18 = v15 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 if ( v13 <= v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 v18 = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 v19 = v2->normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 v20 = v2->normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 v2->sMinX = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 v21 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 if ( v19 >= v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 v2->sMaxY = v21 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 v22 = v15 + v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 if ( v19 <= v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 v22 = v20 + v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 v23 = v2->normal2.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 v2->sMinY = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 v24 = v2->normal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 if ( v24 >= v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 v25 = v23 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 v25 = v24 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 v2->sMaxZ = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 v26 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 if ( v12 <= v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 v27 = v28 + v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 v27 = v12 + v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 v2->uFaceID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 v2->field_80 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 v2->field_88 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 v2->sMinZ = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 v2->field_7C = 0xFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 //----- (004706C6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 void __cdecl UpdateActors_ODM()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 Actor *v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 unsigned __int16 v1; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 unsigned int v2; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 int v3; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 int v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 int v6; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 signed int v7; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 signed int v8; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 unsigned __int8 v9; // zf@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 unsigned __int8 v10; // sf@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 unsigned __int16 v11; // ax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 int v12; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 unsigned __int64 v13; // qax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 int v14; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 unsigned __int64 v15; // qax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 int v16; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 int v17; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 int v18; // edx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 int v19; // ecx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 __int16 v20; // ax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 int v21; // ebx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 int v22; // edi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 int v23; // ecx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 __int16 v24; // ax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 int v25; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 signed int v26; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 int v27; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 int v28; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 signed int v29; // ebx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 signed int v30; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 int v31; // edi@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 signed int i; // ebx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 unsigned int v33; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 int v34; // ebx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 int v35; // edi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819 int v36; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 unsigned __int16 v37; // cx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 signed int v38; // edx@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 signed int v39; // edi@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823 BSPModel *v40; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 ODMFace *v41; // edi@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 int v42; // ebx@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 int v43; // ecx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 int v44; // edx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 __int16 v45; // dx@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 int v46; // ecx@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 signed int v47; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 int v48; // edi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 int v49; // edi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 int v50; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 unsigned __int64 v51; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 unsigned __int8 v52; // zf@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 unsigned __int8 v53; // sf@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 unsigned __int8 v54; // of@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838 int v55; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 unsigned int v56; // edi@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 int v57; // ST10_4@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 unsigned int v58; // edi@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 unsigned int v59; // ebx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 signed int v60; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 int v61; // eax@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845 Vec3_int_ v62; // [sp+Ch] [bp-44h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 char v63; // [sp+18h] [bp-38h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847 int v64; // [sp+1Ch] [bp-34h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848 int v65; // [sp+20h] [bp-30h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 int v66; // [sp+24h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 bool v67; // [sp+28h] [bp-28h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 unsigned int v68; // [sp+2Ch] [bp-24h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 unsigned int v69; // [sp+30h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 unsigned int v70; // [sp+34h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 int v71; // [sp+38h] [bp-18h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 int v72; // [sp+3Ch] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 int v73; // [sp+40h] [bp-10h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857 int v74; // [sp+44h] [bp-Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 unsigned int v75; // [sp+48h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 int v76; // [sp+4Ch] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 v0 = &pActors[v75];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 v66 = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 v65 = v0->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869 v1 = v0->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 if ( v1 == 11 || v1 == 19 || v1 == 17 || !v0->uMovementSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 goto LABEL_121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 v2 = v0->pMonsterInfo.uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 v69 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 if ( MonsterStats::BelongsToSupertype(v2, MONSTER_SUPERTYPE_WATER_ELEMENTAL) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 v4 = v0->pMonsterInfo.uFlying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 v0->uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 v74 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 if ( !v0->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 v74 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 v70 = GetTerrainHeightsAroundParty(v0->vPosition.x, v0->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 v5 = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 v0->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 v0->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 v0->vPosition.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 v0->uActorHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 &v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 (int *)&v69,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1891 v6 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1892 v7 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 v68 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1894 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1895 v67 = v69 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 if ( v6 > v5 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 v72 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 if ( v0->uAIState == 5 && v76 && !v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 v0->uAIState = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 goto LABEL_121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 if ( v0->uCurrentActionAnimation == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 v8 = v0->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 v9 = HIDWORD(v0->pActorBuffs[7].uExpireTime) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 v10 = SHIDWORD(v0->pActorBuffs[7].uExpireTime) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 v73 = v0->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 if ( !v10 && (!(v10 | v9) || LODWORD(v0->pActorBuffs[7].uExpireTime) > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 v8 = (signed __int64)((double)v73 * 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 v73 = (signed __int64)((double)v73 * 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 v11 = v0->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 if ( v11 == 7 || v11 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 v8 *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 v73 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 v8 = (signed __int64)((double)v73 * flt_6BE3AC_debug_recmod1_x_1_6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 if ( v8 > 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 v8 = 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 v12 = stru_5C6E00->SinCos(v0->uYawAngle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 v69 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 v13 = v12 * (signed __int64)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 v73 = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 v0->vVelocity.x = WORD1(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 v69 = stru_5C6E00->SinCos(v0->uYawAngle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 v73 = (unsigned __int64)((signed int)v69 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 v9 = v74 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 v0->vVelocity.y = v69 * v8 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 v14 = stru_5C6E00->SinCos(v0->uPitchAngle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 v69 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 v15 = v14 * (signed __int64)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 v73 = v15 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 v0->vVelocity.z = WORD1(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 v7 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 v73 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 v69 = 55000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 v73 = (unsigned __int64)(55000i64 * v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 v0->vVelocity.x = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 v73 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 v73 = (unsigned __int64)((signed int)v69 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 v9 = v74 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 v0->vVelocity.y = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 v69 = 55000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 v73 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 v73 = (unsigned __int64)(55000i64 * v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 v0->vVelocity.z = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 if ( v0->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 v16 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 v0->vPosition.z = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 v0->vVelocity.z = v16 != 0 ? 0x14 : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 if ( !v72 || v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 if ( v70 && !v72 && v67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 v18 = v0->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 v19 = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 v0->vPosition.z = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 _46DCC8_get_gravity_direction_outdoor(v19, v18, &v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 v20 = GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 v21 = v62.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 v22 = v62.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 v23 = v62.y * v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 v0->vVelocity.z += -8 * LOWORD(pEventTimer->uTimeElapsed) * v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 v73 = abs(v62.x * v0->vVelocity.x + v22 * v0->vVelocity.z + v23) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 v72 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 v0->vVelocity.x += (unsigned int)(v73 * v62.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 v72 = (unsigned __int64)(v73 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 v24 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 v72 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 v0->vVelocity.y += v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 v72 = (unsigned __int64)(v73 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 v0->vVelocity.z += v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 v0->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 if ( pParty->field_1613C != v17 && v0->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 v0->vVelocity.x += rand() % 100 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 v0->vVelocity.y += rand() % 100 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 v0->vVelocity.z += rand() % 100 - 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 v25 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 v0->uAIState = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 v0->uYawAngle += v25 % 32 - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 v0->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 if ( v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y < 400 && v70 == v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 v0->vVelocity.y = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 v0->vVelocity.x = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 v9 = v0->pMonsterInfo.uFlying == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 v26 = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 v26 = v0->uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 v27 = v0->uActorHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 stru_721530.field_8 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 stru_721530.prolly_normal_d = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 stru_721530.field_C = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 stru_721530.field_70 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 v69 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 stru_721530.field_34.x = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 stru_721530.field_34.y = v0->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 stru_721530.normal.y = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 v28 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 stru_721530.normal.z = v28 + v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 stru_721530.field_34.z = v28 - v26 + stru_721530.field_C - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 if ( stru_721530.field_34.z < stru_721530.normal.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 stru_721530.field_34.z = v28 + v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 stru_721530.field_1C = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 stru_721530.field_20 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 stru_721530.field_24 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 if ( stru_721530._47050A(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 _46E889_collide_against_bmodels(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 v29 = WorldPosToGridCellZ(v0->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 v30 = WorldPosToGridCellX(v0->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 _46E26D_collide_against_sprites(v30, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 _46EF01_collision_chech_player(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 _46ED8A_collide_against_layingItems(8 * v75 | 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 for ( i = 0; v31 < ai_arrays_size; ++v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 v33 = ai_array_4F7DB0_actor_ids[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 if ( v33 != v75 && _46DF1A_collide_against_actor(v33, 40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 v71 = i > 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 if ( stru_721530.field_7C < stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 v70 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 v35 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 v36 = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 stru_721530.normal2.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 stru_721530.normal2.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 v0->uActorHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 (int *)&v63,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 &v64,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 if ( v76 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 if ( v35 < v36 + 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 v37 = v0->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 if ( v37 == 5 || v37 == 4 || v37 == 11 || v37 == 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 if ( v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 v61 = v36 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 v61 = v68 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 sub_42F960_create_object(v0->vPosition.x, v0->vPosition.y, v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 v0->uAIState = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 v0->vPosition.x = LOWORD(stru_721530.normal2.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 v0->vPosition.y = LOWORD(stru_721530.normal2.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 v0->vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 v72 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 v0->vPosition.x += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 v72 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 v0->vPosition.y += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 v72 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 v38 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 v0->vPosition.z += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 v39 = v38 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 switch ( v38 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 if ( pParty->bTurnBasedModeOn != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 goto LABEL_97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 if ( pTurnEngine->field_4 != 2 && pTurnEngine->field_4 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 LABEL_97:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 if ( v0->pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 if ( v71 == v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 goto LABEL_99;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 LABEL_101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 Actor::_403F58(v75, 4, v34, (AIDirection *)v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 if ( v71 != v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 goto LABEL_101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 if ( pActors[v39].pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 LABEL_99:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 Actor::_402968(v75, v38, v34, (AIDirection *)v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2126 LABEL_103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 Actor::FaceObject(v75, v38, v34, (AIDirection *)v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 if ( !v0->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 v38 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 goto LABEL_103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 v52 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 v53 = SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 v0->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 v0->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 if ( !v53 && (!(v53 | v52) || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 v47 = sub_452A9E(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 v48 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 v0->vPosition.x - pLevelDecorations[v39].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 v0->vPosition.y - pLevelDecorations[v39].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 v71 = stru_5C6E00->SinCos(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 v70 = (unsigned __int64)(v71 * (signed __int64)v47) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 v49 = v48 - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 v0->vVelocity.x = (unsigned int)(v71 * v47) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 v50 = stru_5C6E00->SinCos(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 v71 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 v51 = v50 * (signed __int64)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 v70 = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 v0->vVelocity.y = WORD1(v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 v40 = &pOutdoor->pBModels[v38 >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 v41 = &v40->pFaces[v39 & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 if ( !(BYTE3(v41->uFaceAttributes) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 v42 = v41->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 if ( v42 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 v43 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 v44 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 v0->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 v0->vPosition.z = LOWORD(v40->pVertices.pVertices[v41->pVertexIDs[0]].z) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 if ( v44 * v44 + v43 * v43 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 v0->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 v0->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 v72 = abs(v41->pFacePlane.vNormal.y * v0->vVelocity.y + v41->pFacePlane.vNormal.z * v0->vVelocity.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 + v41->pFacePlane.vNormal.x * v0->vVelocity.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 if ( stru_721530.field_64 >> 3 > v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 v72 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184 v73 = v41->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185 v73 = (unsigned __int64)(v72 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186 v71 = v41->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187 v71 = (unsigned __int64)(v72 * (signed __int64)v71) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 v70 = v41->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 v70 = (unsigned __int64)(v72 * (signed __int64)(signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 v0->vVelocity.x += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 v0->vVelocity.y += v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 v0->vVelocity.z += v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 if ( v42 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 v45 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 v46 = stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 - ((v41->pFacePlane.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 + v41->pFacePlane.vNormal.x * v0->vPosition.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 + v41->pFacePlane.vNormal.y * v0->vPosition.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 + v41->pFacePlane.vNormal.z * v0->vPosition.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 if ( v46 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 v0->vPosition.x += (unsigned int)(v46 * v41->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 v0->vPosition.y += (unsigned int)(v46 * v41->pFacePlane.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 v0->vPosition.z = v45 + ((unsigned int)(v46 * v41->pFacePlane.vNormal.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 v0->uYawAngle = stru_5C6E00->Atan2(v0->vVelocity.x, v0->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 v70 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 v71 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 v70 = (unsigned __int64)(58500i64 * (signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 v0->vVelocity.x = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 v70 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 v70 = (unsigned __int64)(v71 * (signed __int64)(signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 v71 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 v0->vVelocity.y = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 v70 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 v70 = (unsigned __int64)(v71 * (signed __int64)(signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 ++v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 v54 = __OFSUB__(v69, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 v10 = ((v69 - 100) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 v0->vVelocity.z = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 if ( !(v10 ^ v54) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229 v26 = stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 v69 = WorldPosToGridCellX(v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 v55 = WorldPosToGridCellZ(v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 v56 = v55 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 v57 = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 v71 = v55 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 v68 = WorldPosToGridCellX(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 v70 = WorldPosToGridCellZ(v0->vPosition.y) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 v58 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v69, v56) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 v59 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v68, v70) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 if ( v69 == v68 && v71 == v70 && v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 if ( !v67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 if ( !v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 if ( MonsterStats::BelongsToSupertype(v0->pMonsterInfo.uID, MONSTER_SUPERTYPE_WATER_ELEMENTAL) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 v58 = v58 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 v59 = v59 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 if ( !v74 && v58 && !v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 v0->vPosition.x = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 v0->vPosition.y = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 if ( v0->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 v0->uYawAngle -= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 v0->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 v0->uCurrentActionLength = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 v0->uAIState = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 LABEL_121:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 while ( (signed int)v75 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 //----- (0047136C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 void LayingItem::UpdateObject_fn0_BLV(unsigned int uLayingItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 ObjectDesc *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 int v3; // ST08_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 __int16 v4; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 __int16 v5; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 BLVFace *v6; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 BLVFace *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 signed int v8; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 int v9; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 __int16 v10; // di@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 char v11; // al@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 int v12; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 int v13; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 int v14; // ebx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 signed int v15; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 BLVFace *v16; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 int v17; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 int v18; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 int v19; // ecx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 Vec3_short_ *v20; // ecx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 int v21; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 __int16 v22; // ax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 int v23; // edi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 int v24; // edi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 int v25; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 unsigned __int64 v26; // qax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 unsigned __int8 v27; // sf@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 unsigned __int8 v28; // of@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 __int16 v29; // di@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 char v30; // al@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310 const char *v31; // [sp-8h] [bp-98h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 const char *v32; // [sp-8h] [bp-98h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2312 enum TEXTURE_TYPE v33; // [sp-4h] [bp-94h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2313 enum TEXTURE_TYPE v34; // [sp-4h] [bp-94h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314 Particle_ Dst; // [sp+Ch] [bp-84h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 unsigned int uLayingItemID_; // [sp+74h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2316 ObjectDesc *v37; // [sp+78h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317 int v38; // [sp+7Ch] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318 int v39; // [sp+80h] [bp-10h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2319 int v40; // [sp+84h] [bp-Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2320 int v41; // [sp+88h] [bp-8h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 int v42; // [sp+8Ch] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2323 uLayingItemID_ = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2324 v1 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325 v2 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326 v3 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 v37 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2328 if ( abs(v3) > 32767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2329 || abs(v1->vPosition.y) > 32767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2330 || abs(v1->vPosition.z) > 20000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2331 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v1->uSectorID, &v38),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2332 v42 <= -30000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2333 && ((v4 = pIndoor->GetSector(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2334 (v1->uSectorID = v4) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2335 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v4, &v38), v42 == -30000)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2337 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2338 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2340 v5 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 if ( v5 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2344 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 stru_721530.field_0 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347 v38 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 stru_721530.prolly_normal_d = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2349 v12 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351 stru_721530.field_C = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 stru_721530.field_8 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2353 stru_721530.field_70 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 stru_721530.field_34.x = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 stru_721530.field_34.y = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 stru_721530.normal.y = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 stru_721530.field_34.z = stru_721530.prolly_normal_d + v1->vPosition.z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 stru_721530.normal.z = stru_721530.field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 stru_721530.field_1C = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 stru_721530.field_20 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 stru_721530.field_24 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 stru_721530.uSectorID = v1->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 if ( stru_721530._47050A(v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 v40 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 _46E44E_collide_against_faces_and_portals(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 _46E0B2_collide_against_decorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 if ( (v1->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 _46EF01_collision_chech_player(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 v13 = v1->field_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2376 v42 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 if ( (v13 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 if ( (signed int)uNumActors > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 v39 = (int)&pActors[0].word_000086_some_monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 v41 = pActors[v1->field_58 >> 3].pMonsterInfo.uID - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 v14 = (signed __int64)((double)v41 * 0.3333333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 v41 = *(short *)(v39 - 38) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387 if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 _46DF1A_collide_against_actor(v42, *((short *)&pMonsterList->pMonsters[*(short *)v39] - 73));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 ++v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390 v39 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 while ( v42 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 if ( (signed int)uNumActors > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 v39 = (int)&pActors[0].word_000086_some_monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 _46DF1A_collide_against_actor(v42++, *((short *)&pMonsterList->pMonsters[*(short *)v39] - 73));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 v39 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 while ( v42 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2413 while ( v40 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2414 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2416 v1->vPosition.x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2417 v1->vPosition.y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2418 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2420 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2421 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2422 memset(&Dst, v8, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2423 v29 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2424 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2426 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2427 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2428 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 if ( v29 & 0x200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2433 Dst.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2434 v30 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2435 v34 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2436 v32 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2438 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2440 if ( v29 & 0x400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2443 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2444 v30 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2445 v34 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 v32 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2448 Dst.field_20 = (unsigned __int8)(v30 & 0x80) + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2449 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v32, v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2450 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2452 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2453 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2454 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2455 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2457 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2458 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 if ( v2->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2461 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2462 v15 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2463 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2465 v40 = sub_452A9E(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2466 v23 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2467 v1->vPosition.x - pLevelDecorations[v15].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2468 v1->vPosition.y - pLevelDecorations[v15].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2469 v42 = stru_5C6E00->SinCos(v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2470 v41 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2471 v24 = v23 - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2472 v1->vVelocity.x = (unsigned int)(v42 * v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2473 v25 = stru_5C6E00->SinCos(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2474 v42 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2475 v26 = v25 * (signed __int64)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2476 v41 = v26 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2477 v1->vVelocity.y = WORD1(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2479 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2481 if ( (stru_721530.uFaceID & 7) != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2482 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2483 stru_721530.field_84 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2484 v16 = &pIndoor->pFaces[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2485 if ( v16->uPolygonType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2487 v42 = abs(v16->pFacePlane_old.vNormal.x * v1->vVelocity.x + v16->pFacePlane_old.vNormal.z * v1->vVelocity.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2488 + v16->pFacePlane_old.vNormal.y * v1->vVelocity.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2489 if ( stru_721530.field_64 >> 3 > v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2490 v42 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2491 v40 = v16->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2492 v40 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2493 v41 = v16->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2494 v41 = (unsigned __int64)(v42 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2495 v39 = v16->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2496 v39 = (unsigned __int64)(v42 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 v1->vVelocity.x += 2 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2498 v1->vVelocity.y += 2 * v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 if ( v16->pFacePlane_old.vNormal.z <= 32000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2501 v22 = 2 * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2503 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2505 v21 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2506 v40 = 32000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2507 v1->vVelocity.z += v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2508 v41 = (unsigned __int64)(v40 * (signed __int64)v21) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2509 v22 = (unsigned int)(v40 * v21) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2511 v1->vVelocity.z += v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2512 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2514 if ( v37->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2516 v17 = -v1->vVelocity.z >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2517 v1->vVelocity.z = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2518 if ( (signed __int16)v17 < 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2519 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2520 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2521 if ( BYTE3(v16->uAttributes) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2522 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2523 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 v18 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2526 v19 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 if ( v19 * v19 + v18 * v18 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2529 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2530 v20 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2532 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2533 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2534 v1->vPosition.z = v20[*v16->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2536 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2537 v2 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2538 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2539 v41 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2540 v40 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2541 v41 = (unsigned __int64)(58500i64 * v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2542 v1->vVelocity.x = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2543 v41 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2545 v40 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2546 v1->vVelocity.y = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2547 v41 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2548 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2549 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2550 v28 = __OFSUB__(v38, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2551 v27 = v38 - 100 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 v1->vVelocity.z = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 if ( !(v27 ^ v28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2554 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 if ( v42 <= v1->vPosition.z - 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2560 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 if ( !(v5 & 0x40) || _46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 v6 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 v1->vPosition.z = v42 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2567 v7 = &v6[v38];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 if ( v7->uPolygonType == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2571 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 if ( v7->pFacePlane_old.vNormal.z < 45000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 v42 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 v38 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 v42 = (unsigned __int64)(58500i64 * v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 v1->vVelocity.x = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 v42 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 v42 = (unsigned __int64)(v38 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 v38 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2586 v1->vVelocity.y = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 v42 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 v42 = (unsigned __int64)(v38 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2589 v9 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2590 v1->vVelocity.z = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 if ( v9 * v9 + v1->vVelocity.y * v1->vVelocity.y < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2593 v1->vVelocity.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2594 v1->vVelocity.y = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2595 v1->vVelocity.x = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 memset(&Dst, v8, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 v10 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2600 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2603 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2606 if ( v10 & 0x200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2609 Dst.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2610 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 v11 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 v33 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2613 v31 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2617 if ( v10 & 0x400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2619 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2620 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 Dst.field_20 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2623 Dst.uTextureID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2626 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2629 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 v11 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2632 v33 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2633 v31 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2635 Dst.field_20 = (unsigned __int8)(v11 & 0x80) + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v31, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2637 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2638 pGame->pParticleEngine->AddParticle(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2641 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 //----- (00471C03) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2647 void LayingItem::UpdateObject_fn0_ODM(unsigned int uLayingItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2649 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2650 ObjectDesc *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2651 signed int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2652 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2653 int v5; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2654 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2655 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2656 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2657 int v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2658 __int16 v10; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2659 int v11; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2660 int v12; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2661 signed int v13; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2662 signed int v14; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2663 int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2664 int v16; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2665 int v17; // ST10_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2666 signed int v18; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2667 signed int v19; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2668 Actor *v20; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2669 int v21; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2670 int v22; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 __int16 v23; // bx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 char v24; // al@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2673 signed int i; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2674 int v26; // edi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2675 int v27; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2676 __int16 v28; // cx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 int v29; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2678 signed int v30; // edi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2679 BSPModel *v31; // ecx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2680 ODMFace *v32; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2681 int v33; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 int v34; // ecx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 int v35; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2684 Actor *v36; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2685 __int16 v37; // ax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2686 int v38; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2687 int v39; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 unsigned __int64 v40; // qax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689 int v41; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 unsigned __int8 v42; // sf@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 unsigned __int8 v43; // of@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2692 int v44; // eax@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2693 __int16 v45; // bx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 int v46; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695 const char *v47; // [sp-8h] [bp-B0h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2696 enum TEXTURE_TYPE v48; // [sp-4h] [bp-ACh]@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2697 int v49; // [sp+Ch] [bp-9Ch]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2698 int v50; // [sp+10h] [bp-98h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2699 Vec3_int_ v51; // [sp+14h] [bp-94h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 Particle_ Dst; // [sp+20h] [bp-88h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 unsigned int uLayingItemID_; // [sp+88h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2702 int v54; // [sp+8Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2703 int v55; // [sp+90h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704 int v56; // [sp+94h] [bp-14h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 int v57; // [sp+98h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 int v58; // [sp+9Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 int v59; // [sp+A0h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 Actor *v60; // [sp+A4h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2709
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 uLayingItemID_ = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 v1 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 v2 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 v57 = GetTerrainHeightsAroundParty(v1->vPosition.x, v1->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2715 v3 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 v4 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 v5 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 v6 = sub_46D49E_prolly_get_world_y_under_party(v4, v3, v1->vPosition.z, v5, &v59, &v55, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 v54 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 v8 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 if ( v1->vPosition.z <= v6 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 if ( v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 v9 = v6 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 if ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 v9 = v7 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 v7 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 v58 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 v10 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 if ( !(v10 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 if ( v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2747 if ( v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 v11 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 v12 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2752 _46DCC8_get_gravity_direction_outdoor(v12, v11, &v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 v56 = abs(v51.y * v1->vVelocity.y + v51.z * v1->vVelocity.z + v51.x * v1->vVelocity.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 v1->vVelocity.x += (unsigned int)(v56 * v51.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2757 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2758 v1->vVelocity.y += (unsigned int)(v56 * v51.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2759 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 v1->vVelocity.z += (unsigned int)(v56 * v51.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2761 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2762 v7 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2763 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2765 if ( v10 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2767 if ( v1->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2768 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 if ( !_46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2770 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2773 if ( !(v2->uFlags & 0x80) || (v21 = -v1->vVelocity.z >> 1, v1->vVelocity.z = v21, (signed __int16)v21 < 10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2775 v60 = (Actor *)v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 v55 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 v60 = (Actor *)((unsigned __int64)(58500i64 * (signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2778 v1->vVelocity.x = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2779 v60 = (Actor *)v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 v60 = (Actor *)((unsigned __int64)(v55 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 v55 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 v1->vVelocity.y = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 v60 = (Actor *)v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2784 v60 = (Actor *)((unsigned __int64)(v55 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2785 v22 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 v1->vVelocity.z = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 if ( v1->vVelocity.y * v1->vVelocity.y + v22 * v22 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2788 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2791 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2793 memset(&Dst, 0, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2794 v23 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2795 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2796 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2797 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2798 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2799 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2800 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2801 if ( HIBYTE(v23) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2803 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2804 Dst.uDiffuse = 16727070;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2807 LABEL_83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2808 v47 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2810 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2812 if ( HIBYTE(v23) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2814 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2816 Dst.field_20 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 Dst.uTextureID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2818 LABEL_89:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2819 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2820 pGame->pParticleEngine->AddParticle(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2823 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2824 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2825 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2826 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2827 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 v47 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2830 Dst.field_20 = (unsigned __int8)(v24 & 0x80) + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v47, v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2832 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 if ( v1->vPosition.z > v7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2836 && (v13 = v1->vPosition.x, v13 >= -32768)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 && v13 <= 32768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 && (v14 = v1->vPosition.y, v14 >= -32768)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2839 && v14 <= 32768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 && v1->vPosition.z <= 13000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 || !(v2->uFlags & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2842 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 if ( v1->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 if ( _46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2847 LABEL_92:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 stru_721530.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2850 stru_721530.prolly_normal_d = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 stru_721530.field_C = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 stru_721530.field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 stru_721530.field_34.x = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2857 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2858 v15 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2859 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2860 stru_721530.field_34.y = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 stru_721530.normal.y = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2862 stru_721530.field_34.z = v1->vPosition.z + stru_721530.prolly_normal_d + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2863 stru_721530.normal.z = stru_721530.field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2864 stru_721530.field_1C = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2865 stru_721530.field_20 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2866 stru_721530.field_24 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2867 if ( stru_721530._47050A(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2868 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2869 _46E889_collide_against_bmodels(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2870 v16 = WorldPosToGridCellZ(v1->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 v17 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2872 v58 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2873 v18 = WorldPosToGridCellX(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874 _46E26D_collide_against_sprites(v18, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2875 if ( (v1->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2876 _46EF01_collision_chech_player(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 if ( (v1->field_58 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 v19 = v1->field_58 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 if ( v19 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2882 if ( v19 < (signed int)(uNumActors - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2887 v60 = pActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2888 v20 = &pActors[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2889 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2891 if ( v20->GetActorsRelation(v60) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2892 _46DF1A_collide_against_actor(v56, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2893 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2894 ++v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2896 while ( v56 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906 v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907 v27 = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908 stru_721530.normal2.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909 stru_721530.normal2.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2911 v2->uHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 &v49,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 &v50,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 if ( v59 && v26 < v27 + 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2917 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2918 v44 = v27 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2919 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2920 v44 = v54 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2921 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2922 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2923 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2925 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927 v1->vPosition.x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2928 v1->vPosition.y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 memset(&Dst, 0, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2934 v45 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2940 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 if ( HIBYTE(v45) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2943 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2944 Dst.uDiffuse = 16727070;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2945 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 goto LABEL_83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 if ( HIBYTE(v45) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2951 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 v46 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953 Dst.uTextureID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 Dst.uDiffuse = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 Dst.field_20 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2960 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2966 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 v28 = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 v29 = v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 v1->uSectorID = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2974 if ( v2->uFlags & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 if ( v29 < v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977 v1->vPosition.z = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2979 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2981 v30 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2983 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2986 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2987 v32 = &v31->pFaces[v30 & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988 if ( v32->uPolygonType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 v56 = abs(v32->pFacePlane.vNormal.z * v1->vVelocity.z + v32->pFacePlane.vNormal.y * v1->vVelocity.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2991 + v32->pFacePlane.vNormal.x * v1->vVelocity.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2992 if ( stru_721530.field_64 >> 3 > v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 v56 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994 v57 = v32->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995 v57 = (unsigned __int64)(v56 * (signed __int64)v57) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 v58 = v32->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 v58 = (unsigned __int64)(v56 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 v60 = (Actor *)v32->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 v1->vVelocity.x += 2 * v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 v1->vVelocity.y += 2 * v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 if ( v32->pFacePlane.vNormal.z <= 32000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 v37 = 2 * (short)v60;
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 v36 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 v57 = 32000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 v1->vVelocity.z += (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 v58 = (unsigned __int64)(v57 * (signed __int64)(signed int)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012 v37 = (unsigned int)(v57 * (int)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014 v1->vVelocity.z += v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 if ( BYTE3(v32->uFaceAttributes) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 EventProcessor(v32->sCogTriggeredID, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 v34 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 v1->vPosition.z = v33 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 if ( v1->vVelocity.y * v1->vVelocity.y + v34 * v34 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 LOWORD(v35) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 v58 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 v57 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 v58 = (unsigned __int64)(58500i64 * v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 v1->vVelocity.x = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 v58 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 v57 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 v1->vVelocity.y = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 v58 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 v43 = __OFSUB__(v55, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 v42 = v55 - 100 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 v1->vVelocity.z = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 if ( !(v42 ^ v43) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 v57 = sub_452A9E(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 v38 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 v1->vPosition.x - pLevelDecorations[v30].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 v1->vPosition.y - pLevelDecorations[v30].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 v56 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 v39 = stru_5C6E00->SinCos(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 v60 = (Actor *)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 v40 = v39 * (signed __int64)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 v58 = v40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 v1->vVelocity.x = WORD1(v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 v41 = stru_5C6E00->SinCos(v56 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 v60 = (Actor *)v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 v58 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 v1->vVelocity.y = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 //----- (0047253E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 void __cdecl UpdateObjects()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 unsigned int v0; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 __int16 v3; // dx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 ObjectDesc *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 int v5; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 __int16 v6; // cx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 signed int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 __int16 v8; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 unsigned int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 signed int v11; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 int v12; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 int v14; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 unsigned int v15; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 unsigned int v16; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 unsigned int v17; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 int v18; // [sp+4h] [bp-10h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 int v19; // [sp+8h] [bp-Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 signed int v20; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 v2 = (char *)&pLayingItems[0].uSpriteFrameID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106 LOWORD(v0) = *((short *)v2 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 if ( v0 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 v0 &= 0xFFFFFFBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 *((short *)v2 - 2) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 v3 = *((short *)v2 - 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 v4 = &pObjectList->pObjects[*((short *)v2 - 14)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 if ( (v0 & 0x80u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 v5 = *(int *)(v2 + 62) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 *(int *)(v2 - 26) = pActors[v5].vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 *(int *)(v2 - 22) = pActors[v5].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 *(int *)(v2 - 18) = pActors[v5].vPosition.z + pActors[v5].uActorHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 if ( !v3 || (v6 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2, *(short *)v2 = v6, !(v4->uFlags & 4)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124 if ( v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3126 v7 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 v7 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 if ( v6 < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3132 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3136 v8 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 *(short *)v2 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3138 v9 = v4->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3139 if ( !(v9 & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 if ( v8 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3145 LayingItem::_42F933(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3148 v11 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3149 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 v11 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3151 if ( v8 < v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 LayingItem::UpdateObject_fn0_BLV(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 LayingItem::UpdateObject_fn0_ODM(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3158 if ( pParty->bTurnBasedModeOn != 1 || !(*(v2 - 4) & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 v12 = abs(pParty->vPosition.x - *(int *)(v2 - 26));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3161 v18 = abs(pParty->vPosition.z - *(int *)(v2 - 22));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 v19 = abs(pParty->vPosition.y - *(int *)(v2 - 18));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3163 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3164 v14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 v15 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3166 if ( v12 < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 v13 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 v14 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 if ( v13 < v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 v16 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 v13 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 if ( v14 < (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 v17 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 v14 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 v0 = (unsigned int)(11 * v14) >> 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 if ( (signed int)(v0 + (v15 >> 2) + v13) <= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 v10 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 if ( !(v9 & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 _46BFFA_check_object_intercept(v1, 8 * v1 | OBJECT_Item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3196 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 v2 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3198 v1 = v20++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 while ( v20 < (signed int)uNumLayingItems );
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 //----- (0047272C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 int __fastcall _47272C_collide_agains_some_secotors_floors(int x, int y, int z, unsigned int *pSectorID, int *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 signed int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 int v7; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 signed int v8; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 v5 = x - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 v7 = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 v8 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 *pSectorID = pIndoor->GetSector(x - 2, y, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3216 result = _46ED1B_collide_against_floor(v5, v8, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3219 *pSectorID = pIndoor->GetSector(v7 + 2, v8, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 result = _46ED1B_collide_against_floor(v7 + 2, v8, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 *pSectorID = pIndoor->GetSector(v7, v8 - 2, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 result = _46ED1B_collide_against_floor(v7, v8 - 2, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 *pSectorID = pIndoor->GetSector(v7, v8 + 2, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 result = _46ED1B_collide_against_floor(v7, v8 + 2, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 *pSectorID = pIndoor->GetSector(v7, v8, z + 140);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 result = _46ED1B_collide_against_floor(v7, v8, z + 140, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 //----- (00472866) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 void __cdecl BLV_ProcessPartyActions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 float v4; // ST40_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 Player **v5; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 int v6; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 Player **v7; // esi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 signed __int64 v8; // qax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 int v9; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 double v10; // st7@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 BLVFace *v11; // edx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 unsigned int v12; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 double v13; // st7@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 int v14; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 signed __int64 v15; // qax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 double v16; // st7@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 int v17; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 double v18; // st7@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 int v19; // ST40_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 int v20; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 double v21; // st7@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 int v22; // ST40_4@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 int v23; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 double v24; // st7@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 int v25; // ST40_4@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 int v26; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 double v27; // st7@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 int v28; // ST40_4@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 int v29; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 double v30; // st7@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 int v31; // ST3C_4@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 int v32; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 double v33; // st7@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 int v34; // ST3C_4@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 unsigned int v35; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 int v36; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 int v37; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 int v38; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 int v39; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 int v40; // eax@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 Player **v41; // esi@113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 int v42; // eax@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 signed int v43; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 BLVFace *v44; // esi@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 PolygonType v45; // al@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 int v46; // ecx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 char v47; // zf@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 int v48; // eax@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 int v49; // ST40_4@136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 int v50; // ST40_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 int v51; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 int v52; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 signed int v53; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 int v54; // ebx@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 int v55; // ST30_4@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 AudioPlayer *v56; // ecx@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 SoundID v57; // [sp-20h] [bp-80h]@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 signed int v58; // [sp-1Ch] [bp-7Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 unsigned int v59; // [sp-18h] [bp-78h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 signed int v60; // [sp-14h] [bp-74h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 signed int v61; // [sp-10h] [bp-70h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 int v62; // [sp-Ch] [bp-6Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 int v63; // [sp-8h] [bp-68h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 unsigned int v64; // [sp-8h] [bp-68h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 int v65; // [sp-4h] [bp-64h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 int v66; // [sp-4h] [bp-64h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 double v67; // [sp+Ch] [bp-54h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 int v68; // [sp+10h] [bp-50h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 int v69; // [sp+10h] [bp-50h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 int v70; // [sp+14h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 signed int v71; // [sp+18h] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 signed int v72; // [sp+1Ch] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 signed int v73; // [sp+20h] [bp-40h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 int v74; // [sp+20h] [bp-40h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 signed int bFeatherFall; // [sp+24h] [bp-3Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3319 bool bFeatherFalla; // [sp+24h] [bp-3Ch]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 unsigned int v77; // [sp+28h] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 int v78; // [sp+2Ch] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 int v79; // [sp+30h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 int i; // [sp+34h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324 int v81; // [sp+38h] [bp-28h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 int v82; // [sp+3Ch] [bp-24h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 int v83; // [sp+40h] [bp-20h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 int bJumping; // [sp+44h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 int v85; // [sp+48h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 int v86; // [sp+4Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 int v87; // [sp+50h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 float v88; // [sp+54h] [bp-Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 int v89; // [sp+58h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 int angle; // [sp+5Ch] [bp-4h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 v0 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 v89 = pParty->uFallSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 v85 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 v86 = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342 v87 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 v77 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 bJumping = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 v3 = v0 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 i = _46ED1B_collide_against_floor(v86, v85, v3, &v77, &v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 if ( i == -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 i = _47272C_collide_agains_some_secotors_floors(v86, v85, v3, &v77, &v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 if ( i == -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 pParty->vPosition.x = blv_prev_party_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 pParty->vPosition.z = blv_prev_party_z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 pParty->vPosition.y = blv_prev_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 pParty->uFallStartY = blv_prev_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 blv_prev_party_x = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 blv_prev_party_z = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 blv_prev_party_y = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 if ( pParty->bTurnBasedModeOn != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 v4 = (double)(GetTickCount() / 0x1F4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 v67 = v4 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 if ( *(int *)&word_720C10_intercepts_xs[102] != LODWORD(v67) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 dword_4F8584[3 * dword_4F8580[0]] = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 dword_4F8588[3 * dword_4F8580[0]] = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 dword_4F8580[3 * dword_4F8580[0]++ + 3] = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 if ( dword_4F8580[0] > 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 dword_4F8580[0] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 *(int *)&word_720C10_intercepts_xs[102] = LODWORD(v67);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 if ( SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 || SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 && LODWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 bFeatherFall = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 v5 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 while ( !(*v5)->WearsItem(536, 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 if ( (signed int)v5 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 v6 = pParty->uFallStartY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 v6 = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 bFeatherFall = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 pParty->uFallStartY = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 if ( v6 - v87 > 512 && !bFeatherFall && v87 <= i + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 v7 = &pPlayers[1]; // receive falling damage
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 if ( !(*v7)->HasEnchantedItemEquipped(72) && !(*v7)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 v8 = (signed __int64)((double)(*v7)->GetMaxHealth() * 0.1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 (*v7)->ReceiveDamage((pParty->uFallStartY - v87) * (signed int)v8 / 256, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 v9 = (*v7)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 v10 = (double)(20 - (*v7)->_48EA1B_get_static_effect(v9)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 (*v7)->SetRecoveryTime((signed __int64)v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 while ( (signed int)v7 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 if ( v87 > i + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 bFeatherFalla = v87 - i <= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 if ( v87 - i <= 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 if ( bWalkSound && pParty->field_6F8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 if ( v87 > i + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 v87 = i + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 pParty->uFallStartY = i + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 if ( pParty->field_6F4_packedid != v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 v11 = &pIndoor->pFaces[v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449 if ( BYTE3(v11->uAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 v70 = pIndoor->pFaceExtras[v11->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 pParty->field_6F4_packedid = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 v68 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 if ( pIndoor->pFaces[v79].uAttributes & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 v71 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 v81 = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 angle = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 v83 = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 / 180)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 case PARTY_TurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3474 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 v13 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 case PARTY_TurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 v16 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 case PARTY_FastTurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 v14 = angle + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 v13 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 v14 = angle + (unsigned __int64)(signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 angle = stru_5C6E00->uDoublePiMask & v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 case PARTY_FastTurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 v16 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 v15 = (signed __int64)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 angle = stru_5C6E00->uDoublePiMask & (angle - v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 case PARTY_StrafeLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 v17 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 v18 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 v88 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 v19 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v88 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 case PARTY_StrafeRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 v21 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 v88 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 v22 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v88 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 goto LABEL_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 case PARTY_WalkForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 v23 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 v24 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 v88 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 v25 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v88 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 v1 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 case PARTY_WalkBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 v26 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 v27 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 v88 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 v78 = (unsigned __int64)(v26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 v28 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 v78 = (unsigned __int64)(v28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 * (signed __int64)(signed int)(signed __int64)(v88 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 LABEL_68:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 v1 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 case PARTY_RunForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 v29 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 v30 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 v88 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 v2 += (unsigned __int64)(v29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 * (unsigned __int64)(signed __int64)(v30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 v1 += (unsigned __int64)(v31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 * (unsigned __int64)(signed __int64)(v88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 case PARTY_RunBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 v32 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 v33 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 v88 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 v2 -= (unsigned __int64)(v32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 * (signed __int64)(signed int)(signed __int64)(v33 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 v1 -= (unsigned __int64)(v34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 * (signed __int64)(signed int)(signed __int64)(v88 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 v72 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 case PARTY_LookUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 v83 += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 if ( v83 > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 v83 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 v63 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 case PARTY_LookDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 v83 += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 if ( v83 < -128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 v83 = -128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 v63 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 pPlayers[v35]->PlaySound(v63, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 case PARTY_CenterView:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 case PARTY_Jump:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 if ( (!bJumping || v87 <= i + 6 && v89 <= 0) && pParty->field_24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 v89 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3614 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618 pParty->sRotationY = angle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619 pParty->sRotationX = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3620 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3622 v89 += -2 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626 if ( pIndoor->pFaces[v68].pFacePlane_old.vNormal.z < 32768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 v89 -= pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3633 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 if ( bJumping != v36 && v89 <= v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 if ( v89 < -500 && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3639 v41 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 (*v41)->PlayEmotion(46, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3644 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3646 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 LABEL_92:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 stru_721530.field_8 = pParty->field_14 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3662 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 v37 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3668 stru_721530.field_34.x = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 stru_721530.normal.x = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 stru_721530.field_1C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 stru_721530.field_34.y = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 stru_721530.normal.y = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 stru_721530.field_20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 stru_721530.normal.z = stru_721530.prolly_normal_d + v87 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 stru_721530.field_34.z = stru_721530.field_C + v87 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 stru_721530.field_24 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 stru_721530.uSectorID = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3680 v38 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681 if ( stru_721530._47050A(v38) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3683 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3684 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3686 _46E44E_collide_against_faces_and_portals(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3687 _46E0B2_collide_against_decorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3689 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3690 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 while ( v73 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3695 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 v39 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3698 v77 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 v39 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16) + v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 v77 = v85 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 v40 = v37 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3707 v42 = _46ED1B_collide_against_floor(v39, v77, v40 + 40, &stru_721530.uSectorID, &v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3708 if ( v42 == -30000 || v42 - v37 > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3709 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3712 v86 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 v85 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714 v37 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717 v86 += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 v85 += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 v43 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 v77 = stru_721530.uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 v53 = sub_452A9E(v2 * v2 + v1 * v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 i = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 v54 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 v86 - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 v85 - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 v2 = (unsigned __int64)(stru_5C6E00->SinCos(v54) * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 v1 = (unsigned __int64)(v55 * (signed __int64)i) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 v45 = v44->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 if ( v45 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 if ( v89 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 v87 = pIndoor->pVertices[*v44->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 if ( pParty->uFallStartY - v87 < 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 goto LABEL_143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 v46 = v89 * v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 v47 = v45 == 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 v48 = v44->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 i = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 if ( stru_721530.field_64 >> 3 > i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 i = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 v50 = (unsigned __int64)(i * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771 v81 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772 v81 = (unsigned __int64)(i * (signed __int64)v81) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 v82 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774 v82 = (unsigned __int64)(i * (signed __int64)v82) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3775 v2 += v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777 v74 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3778 v51 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 v69 = v44->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 i = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 v1 += v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 v52 = stru_721530.prolly_normal_d - ((v44->pFacePlane_old.dist + v87 * v74 + v85 * v51 + v86 * v69) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 if ( v52 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 v86 += v52 * v69 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 v85 += v52 * i >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 v87 += v52 * v74 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 LABEL_142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 v43 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 LABEL_143:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 v70 = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 i = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 if ( stru_721530.field_64 >> 3 > i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 i = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 v49 = (unsigned __int64)(i * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 v81 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 v81 = (unsigned __int64)(i * (signed __int64)v81) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 v82 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 v82 = (unsigned __int64)(i * (signed __int64)v82) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 v2 += v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 v1 += v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 if ( v2 * v2 + v1 * v1 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 goto LABEL_142;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3811 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3814 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3815 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3816 v1 = (unsigned __int64)(58500i64 * v1) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3817 ++v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3818 v89 = (unsigned __int64)(58500i64 * v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3819 if ( v83 >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 v37 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3825 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827 if ( sub_452A9E((pParty->vPosition.x - v86) * (pParty->vPosition.x - v86) + (pParty->vPosition.z - v85)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3828 * (pParty->vPosition.z - v85)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 + (pParty->vPosition.y - v37)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 * (pParty->vPosition.y - v37)) <= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 goto LABEL_188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 if ( v72 && (!bJumping || bFeatherFalla) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3835 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3841 if ( !v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3844 if ( BYTE2(pIndoor->pFaces[v79].uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845 v57 = (SoundID)50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847 v57 = (SoundID)64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 v57 = (SoundID)63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 if ( v78 && (!bJumping || bFeatherFalla) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3857 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3858 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3859 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3860 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3861 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 if ( v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 v57 = (SoundID)102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 if ( BYTE2(pIndoor->pFaces[v79].uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 v57 = (SoundID)89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3873 v57 = (SoundID)103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3874 LABEL_175:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3879 LABEL_188:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3880 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3881 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 if ( !bJumping || bFeatherFalla )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3886 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 BYTE1(pParty->uFlags) &= 0xFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 pParty->vPosition.x = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 pParty->vPosition.y = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 pParty->vPosition.z = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 pParty->uFallSpeed = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 if ( !bJumping && BYTE3(pIndoor->pFaces[v79].uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 BYTE1(pParty->uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 if ( v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 EventProcessor(v70, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3898
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3899
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 //----- (00473893) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3901 void __cdecl ODM_ProcessPartyActions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 int _zero; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 int v3; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3907 Player **v4; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 int v5; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3909 int v6; // esi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3910 ODMFace *v7; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 unsigned int v8; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 double v9; // st7@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3913 signed __int64 v10; // qax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 double v11; // st7@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3915 int v12; // ecx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3916 int v13; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917 double v14; // st7@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 int v15; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 double v16; // st7@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 int v17; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 double v18; // st7@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 int v19; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 double v20; // st7@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 int v21; // eax@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 double v22; // st7@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3926 int v23; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 double v24; // st7@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 int v25; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 double v26; // st7@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 int v27; // eax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 double v28; // st7@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 signed __int64 v29; // qax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 unsigned int v30; // eax@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 int v31; // eax@130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 int v32; // ecx@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 signed int v33; // eax@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 int v34; // esi@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 unsigned int v35; // esi@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 int v36; // eax@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 signed int v37; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 signed int v38; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 signed int i; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 int v40; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3944 Player **v41; // esi@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 bool v42; // eax@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 signed int v43; // ecx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 signed int v44; // edx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 int v45; // ecx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 BSPModel *v46; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3950 ODMFace *v47; // esi@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 int v48; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 char v49; // zf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 char v50; // sf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 unsigned __int8 v51; // of@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 int v52; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 unsigned __int8 v53; // dl@205
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 BSPModel *v54; // eax@215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 int v55; // eax@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 signed int v56; // ebx@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 int v57; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 BSPModel *v58; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 unsigned __int64 v59; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 BSPModel *v60; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3964 unsigned __int64 v61; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3965 int v62; // eax@241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 signed int v63; // ST04_4@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 signed int v64; // eax@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 unsigned int v65; // ebx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3969 unsigned int v66; // esi@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3970 int v67; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3971 signed int v68; // ecx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 int v69; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 int v70; // ebx@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 int v71; // esi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3975 int v72; // edi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3976 int v73; // eax@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3977 Player **v74; // esi@283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 int v75; // eax@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 unsigned int v76; // edi@293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 bool v77; // edx@297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3981 bool v78; // ecx@303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3982 int v79; // ecx@314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 __int16 v80; // dx@317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 int v81; // ebx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 int v82; // ecx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 int v83; // eax@321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 Player **v84; // esi@333
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3988 int v85; // eax@334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3989 int v86; // [sp-20h] [bp-B4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3990 int v87; // [sp-20h] [bp-B4h]@248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 signed int v88; // [sp-1Ch] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 unsigned int v89; // [sp-18h] [bp-ACh]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 signed int v90; // [sp-14h] [bp-A8h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 signed int v91; // [sp-10h] [bp-A4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 int v92; // [sp-Ch] [bp-A0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3996 int v93; // [sp-8h] [bp-9Ch]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 unsigned int v94; // [sp-8h] [bp-9Ch]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 int v95; // [sp-4h] [bp-98h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 int v96; // [sp-4h] [bp-98h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4000 int v97; // [sp+Ch] [bp-88h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4001 int v98; // [sp+10h] [bp-84h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 int v99; // [sp+14h] [bp-80h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 int v100; // [sp+18h] [bp-7Ch]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 bool v101; // [sp+1Ch] [bp-78h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4005 int v102; // [sp+20h] [bp-74h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 int v103; // [sp+24h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4007 int bFeatherFall; // [sp+28h] [bp-6Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 int v105; // [sp+2Ch] [bp-68h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 int bWaterWalk; // [sp+30h] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 bool v107; // [sp+34h] [bp-60h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4011 int v108; // [sp+38h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 int v109; // [sp+3Ch] [bp-58h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 int v110; // [sp+40h] [bp-54h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4014 int v111; // [sp+44h] [bp-50h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 int bJumping; // [sp+48h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 int v113; // [sp+4Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 unsigned int v114; // [sp+50h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 int _walk_speed; // [sp+54h] [bp-40h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 int v116; // [sp+58h] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4020 int v117; // [sp+5Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 int v118; // [sp+60h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 Player **v119; // [sp+64h] [bp-30h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 int _angle_x; // [sp+68h] [bp-2Ch]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 int v121; // [sp+6Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 unsigned int v122; // [sp+70h] [bp-24h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 int v123; // [sp+74h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 int v124; // [sp+78h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 int _angle_y; // [sp+7Ch] [bp-18h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 int v126; // [sp+80h] [bp-14h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4030 BSPModel *v127; // [sp+84h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 int v128; // [sp+88h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 int v129; // [sp+8Ch] [bp-8h]@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 int v130; // [sp+90h] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 v121 = pParty->uFallSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 v123 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4039 v103 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 v116 = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 v117 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 bJumping = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 v118 = GetTerrainHeightsAroundParty(pParty->vPosition.x, pParty->vPosition.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4049 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 v102 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 if ( SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 || SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 && LODWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 bFeatherFall = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 v119 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 while ( !(*v119)->WearsItem(536, 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 if ( (signed int)v119 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 bFeatherFall = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 if ( (signed __int64)pParty->pPartyBuffs[18].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4074 bWaterWalk = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4076 if ( !(pParty->pPartyBuffs[18].uFlags & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 && *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[18].uCaster + 10] <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4078 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4080 v3 = sub_46D49E_prolly_get_world_y_under_party(v116, v117, v123, pParty->uPartyHeight, &v130, &v108, bWaterWalk);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4081 v111 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4082 if ( bFeatherFall )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4083 pParty->uFallStartY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 v3 = pParty->uFallStartY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 if ( v3 - v123 > 512 && !bFeatherFall && v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4088 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4090 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4094 v4 = &pPlayers[1]; // receive falling damage
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4095 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 if ( !(*v4)->HasEnchantedItemEquipped(72) && !(*v4)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 v105 = (*v4)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4100 (*v4)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4101 (signed int)((pParty->uFallStartY - v123) * (unsigned __int64)(signed __int64)((double)v105 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4102 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4103 v5 = (*v4)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 v105 = 20 - (*v4)->_48EA1B_get_static_effect(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 (*v4)->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4109 while ( (signed int)v4 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4110 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4113 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4114 if ( pParty->bFlying != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4115 v109 = sub_46D8E3(v116, v117, v123 + pParty->uPartyHeight, (int)&v102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 v107 = v108 == _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 v105 = v111 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4118 if ( v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4120 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4121 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4123 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4127 v101 = v123 - v111 <= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 if ( bWalkSound != _zero && pParty->field_6F8 > _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4130 if ( !bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4131 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < _zero || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 if ( bJumping == _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136 if ( pParty->field_6F4_packedid != (8 * v108 | OBJECT_BModel) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138 if ( v108 != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140 if ( v108 >> 6 < pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142 v7 = (ODMFace *)&pOutdoor->pBModels[v108 >> 6].pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4143 v6 = v108 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144 if ( *(char *)(v7->pFacePlane.vNormal.x + 308 * v6 + 31) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 _walk_speed = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 _angle_y = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4156 _angle_x = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 v126 = pEventTimer->dt_in_some_format;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 v119 = (Player **)((unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160 * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161 / 180)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162 LABEL_118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4167 case PARTY_FlyUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4168 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4172 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4173 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4175 if ( pParty->vPosition.y < 4000 || bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4177 v123 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4178 v113 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4179 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4180 if ( v123 > 4000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4182 v123 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4183 v113 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 if ( v102 && v123 < v109 && (signed int)(pParty->uPartyHeight + v123) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 pParty->field_6E0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 pParty->field_6E4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 BYTE1(pParty->uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 pParty->vPosition.y = v109 - pParty->uPartyHeight - 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 pParty->field_6F0 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 v123 = v109 - pParty->uPartyHeight - 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4201 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 v127 = (BSPModel *)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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 case PARTY_FlyDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4212 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4213 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 v123 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216 v113 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4218 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4219 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4220 v127 = (BSPModel *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 if ( v123 <= v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229 case PARTY_TurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 v9 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235 case PARTY_TurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4237 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4238 goto LABEL_77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 v11 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 case PARTY_FastTurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 v12 = v8 + _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 _angle_y = stru_5C6E00->uDoublePiMask & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 v9 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254 _angle_y = stru_5C6E00->uDoublePiMask & (_angle_y + (unsigned __int64)(signed __int64)v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 case PARTY_FastTurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4258 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4261 v11 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 v10 = (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 LABEL_77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 v12 = _angle_y - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 case PARTY_StrafeLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 v13 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 v14 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 v126 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 *(float *)&v128 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 v124 = (unsigned __int64)(v13 * (signed __int64)((signed int)(signed __int64)(v14 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 v126 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 * (signed __int64)((signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4279 case PARTY_StrafeRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 v15 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281 v16 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4282 v126 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283 *(float *)&v128 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 v124 = (unsigned __int64)(v15 * (signed __int64)((signed int)(signed __int64)(v16 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4285 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 v126 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288 * (signed __int64)((signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289 goto LABEL_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 case PARTY_WalkForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 v17 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 v18 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 v126 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 *(float *)&v128 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 v124 = (unsigned __int64)(v17 * (signed __int64)(signed int)(signed __int64)(v18 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4301 v1 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 case PARTY_WalkBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4304 v19 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305 v20 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306 v126 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4307 *(float *)&v128 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308 v124 = (unsigned __int64)(v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 * (signed __int64)(signed int)(signed __int64)(v20 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 LABEL_90:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316 v1 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 case PARTY_RunForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 v21 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4322 v22 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 v126 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 *(float *)&v128 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4325 v129 = (unsigned __int64)(v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327 * (unsigned __int64)(signed __int64)(v22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4328 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338 if ( v118 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340 v23 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341 v24 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 v126 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343 *(float *)&v128 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 v129 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 v25 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 v26 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354 v114 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 *(float *)&v128 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 v129 = (unsigned __int64)(v25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 * (unsigned __int64)(signed __int64)(v26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 v114 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 v129 = (unsigned __int64)((signed int)v114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 case PARTY_RunBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 v27 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 v28 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 v126 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 *(float *)&v128 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 v29 = (signed __int64)(v28 * fBackwardMovementSlowdownMultiplier);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 v129 = (unsigned __int64)(v126 * (signed __int64)(4 * (signed int)v29)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4382 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4383 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4384 * fBackwardMovementSlowdownMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 v129 = (unsigned __int64)(v126 * (signed __int64)(signed int)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 v124 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403 case PARTY_LookUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 if ( _angle_x > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 _angle_x = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 v93 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 goto _play_player_sound;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 case PARTY_LookDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 if ( _angle_x < -128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 _angle_x = -128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 v93 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 _play_player_sound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 pPlayers[v30]->PlaySound(v93, v95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 case PARTY_CenterView:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 _angle_x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429 case PARTY_Jump:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430 if ( (!v118 || v108) && !bJumping && pParty->field_24 && !(pParty->uFlags & 4) && !(BYTE1(pParty->uFlags) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432 v126 = pParty->field_24 << 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434 v121 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v121);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439 case PARTY_Land:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442 BYTE1(pParty->uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 LABEL_123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 pParty->sRotationY = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 pParty->sRotationX = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 if ( v123 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 LABEL_130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 v31 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459 v126 = stru_5C6E00->SinCos(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 v129 = (unsigned __int64)(4i64 * v126) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 v123 = v113 + v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 v123 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 goto LABEL_141;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 if ( v130 && v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 sub_42F960_create_object(v116, v117, v111);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 pParty->uFallStartY = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4476 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 v113 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4481 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4482 LABEL_141:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484 if ( bJumping && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength());
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 v34 = v121 + 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488 v121 += 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 if ( !v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 v34 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 LABEL_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 if ( bJumping == v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4496 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4497 goto LABEL_164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4499 if ( !bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4501 if ( v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4502 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4503 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 _46DCC8_get_gravity_direction_outdoor(v116, v117, (Vec3_int_ *)&v98);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 v35 = v121 + -8 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 v129 = abs((signed __int64)v2 * (signed __int64)v98 + (signed __int64)v1 * (signed __int64)v99 + (signed __int64)v35 * (signed __int64)v100) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508 v2 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v99) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 v1 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v100) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 v34 = (int)((char *)v127 + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4515 v121 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4516 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 v34 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519 LABEL_164:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4520 if ( !bUnderwater && v34 <= v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4522 if ( v34 < -500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 && !pParty->bFlying
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524 && pParty->vPosition.y - v111 > 1000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 && SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 && (SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 || !LODWORD(pParty->pPartyBuffs[5].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4528 v41 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) && (*v41)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 (*v41)->PlaySound(66, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4533 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4539 LABEL_150:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4540 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4541 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 if ( v2 * v2 + v1 * v1 < 400 && !v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 stru_721530.field_8 = pParty->field_14 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 v126 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4554 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4556 stru_721530.field_34.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 stru_721530.normal.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 stru_721530.field_1C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 stru_721530.field_34.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 stru_721530.normal.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 stru_721530.normal.z = stru_721530.prolly_normal_d + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 stru_721530.field_34.z = stru_721530.field_C + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 stru_721530.field_20 = v128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 stru_721530.field_24 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568 v36 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 if ( stru_721530._47050A(v36) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 _46E889_collide_against_bmodels(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 v37 = WorldPosToGridCellZ(pParty->vPosition.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 v38 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574 _46E26D_collide_against_sprites(v38, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 _46ED8A_collide_against_layingItems(4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 _angle_x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 _angle_y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 _angle_x = v116 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 _angle_y = v117 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588 v127 = (BSPModel *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 v40 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 v122 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592 sub_46D49E_prolly_get_world_y_under_party(_angle_x, _angle_y, v40, pParty->uPartyHeight, &v130, &v108, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593 v129 = sub_46D49E_prolly_get_world_y_under_party(_angle_x, v117, v40, pParty->uPartyHeight, &v130, &v97, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594 v119 = (Player **)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 v116,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 &v110,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4602 v127 = (BSPModel *)GetTerrainHeightsAroundParty(_angle_x, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 v42 = GetTerrainHeightsAroundParty(v116, _angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4605 v118 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 if ( !v97 && !v110 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 v107 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4608 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 if ( bUnderwater || !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4611 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612 if ( v127 && v129 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4613 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 if ( v118 && (signed int)v119 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 if ( v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 if ( v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4619 goto LABEL_198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4620 v127 = (BSPModel *)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 _angle_x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4622 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4623 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4626 &v108,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4627 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628 if ( GetTerrainHeightsAroundParty(_angle_x, _angle_y) && (signed int)v127 <= v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4630 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4631 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634 goto LABEL_199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 LABEL_198:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4638 LABEL_199:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 v116 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 v117 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 v123 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653 v123 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4656 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4662 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 v56 = sub_452A9E(v2 * v2 + v128 * v128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4665 v118 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 v57 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4668 _angle_y - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 v129 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 v58 = (BSPModel *)stru_5C6E00->SinCos(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4671 v127 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672 v59 = (signed int)v58 * (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4673 v122 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 v2 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675 v60 = (BSPModel *)stru_5C6E00->SinCos(v129 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 v127 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 v61 = (signed int)v60 * (signed __int64)v118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 v122 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4679 v128 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4686 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4687 v127 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4689 v48 = v47->pBoundingBox.z2 - v47->pBoundingBox.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4690 v51 = __OFSUB__(v48, 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 v49 = v48 == 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692 v50 = v48 - 32 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693 v52 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694 v129 = (unsigned __int8)(v50 ^ v51 | v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695 v119 = (Player **)(v52 < 46378);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4697 v119 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4698 v53 = v47->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 if ( v53 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701 if ( v121 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 v123 = v127->pVertices.pVertices[v47->pVertexIDs[0]].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704 if ( v2 * v2 + v128 * v128 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 goto LABEL_221;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711 if ( !v129 && (v53 != 4 || v119) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716 v129 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4718 _walk_speed = v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 _walk_speed = (unsigned __int64)(v118 * (signed __int64)_walk_speed) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 v127 = (BSPModel *)v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725 v54 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 v121 += (int)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728 v128 += _walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730 v55 = stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4731 - ((signed int)(v47->pFacePlane.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 + v122 * v47->pFacePlane.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 + _angle_y * v47->pFacePlane.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4734 + _angle_x * v47->pFacePlane.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735 if ( v55 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4737 v116 = _angle_x + (v47->pFacePlane.vNormal.x * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 v117 = _angle_y + (v47->pFacePlane.vNormal.y * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740 v123 = v122 + (v47->pFacePlane.vNormal.z * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 LABEL_220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 LABEL_221:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uFaceAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 pParty->field_6F4_packedid = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748 v103 = v47->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 v122 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 v122 = (unsigned __int64)(v118 * (signed __int64)(signed int)v122) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 v127 = (BSPModel *)v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 v129 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 v121 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 v2 += v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 v128 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 if ( v2 * v2 + v128 * v128 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 goto LABEL_220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4766 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4768 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773 v127 = (BSPModel *)58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4774 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775 v122 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 ++v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 v121 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 while ( v126 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 v122 = abs(pParty->vPosition.x - v116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783 v126 = abs(pParty->vPosition.z - v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 v62 = abs(pParty->vPosition.y - v123);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785 if ( sub_452A9E(v122 * v122 + v126 * v126 + v62 * v62) < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 goto LABEL_344;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 if ( v114 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 if ( !v107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 && !(BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4793 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 v87 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4802 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4803 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4804 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4805 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4808 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 v86 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 LABEL_255:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4811 v63 = WorldPosToGridCellZ(pParty->vPosition.z) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4812 v64 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 v87 = pOutdoor->_47EE49(v64, v63, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 if ( v124 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818 if ( v107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 || BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4821 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 goto LABEL_255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4838 v87 = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 LABEL_257:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4840 pAudioPlayer->PlaySound((SoundID)v87, v88, v89, v90, v91, v92, v94, v96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4844 LABEL_344:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 if ( !bJumping || v101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4852 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4853 v126 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4854 v65 = WorldPosToGridCellZ(pParty->vPosition.z) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4855 v114 = WorldPosToGridCellX(v116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4856 v66 = WorldPosToGridCellZ(v117) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 v127 = (BSPModel *)(((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4858 v122 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v114, v65) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4859 v67 = pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4860 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4861 v69 = ((unsigned int)~v67 >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862 if ( v114 == v126 && v66 == v65 && v122 && v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4863 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866 if ( v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 v70 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 v71 = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870 v72 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872 v73 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873 pParty->vPosition.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 pParty->vPosition.z = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 pParty->vPosition.y = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4879 v73 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4880 pParty->uFallStartY = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881 pParty->vPosition.y = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4884 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v71)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4885 && pParty->vPosition.z == v72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4886 && (v73 = pParty->vPosition.y, pParty->vPosition.y == v70) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888 if ( v73 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891 v73 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4892 pParty->vPosition.y = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4901 v74 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4902 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4904 v110 = (*v74)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4905 (*v74)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4906 (signed int)((pParty->uFallStartY - v70) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4907 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 v75 = (*v74)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4909 v110 = 20 - (*v74)->_48EA1B_get_static_effect(v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 (*v74)->SetRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4911 (signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 while ( (signed int)v74 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 v73 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918 pParty->uFallStartY = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 if ( v102 && v73 < v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 if ( (signed int)(pParty->uPartyHeight + v73) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4924 pParty->vPosition.y = v109 - pParty->uPartyHeight - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4925 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 v76 = pParty->bFlying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933 if ( pParty->bFlying || v101 == 0 || bWaterWalk || !v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4934 v77 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4935 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4936 v77 = v122 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4937 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4938 if ( !pParty->bFlying && v101 != 0 && !bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4940 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4942 v78 = v69 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4943 goto LABEL_306;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4946 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4947 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4948 LABEL_306:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4949 if ( v77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4951 pParty->vPosition.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4952 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953 goto LABEL_313;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 goto LABEL_312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956 if ( v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 LABEL_312:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4959 pParty->vPosition.z = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4960 LABEL_313:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4961 if ( bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4963 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964 v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4965 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4966 if ( !v122 || !v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4968 if ( !v76 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970 v80 = *(short *)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4971 LOBYTE(pParty->uFlags) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 *(short *)v79 = v80 & 0xFFFE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4976 goto LABEL_318;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4978 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4980 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4983 LABEL_318:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4984 v81 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4985 v82 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4986 pParty->vPosition.y = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4987 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989 v82 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4990 pParty->uFallStartY = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 pParty->vPosition.y = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 v83 = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.z, &v110, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999 v82 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 if ( pParty->vPosition.y <= v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001 pParty->uFlags |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v116)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 && pParty->vPosition.z == v117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 && (v82 = pParty->vPosition.y, pParty->vPosition.y == v81) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5007 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 if ( v82 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 v82 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 pParty->vPosition.y = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 v84 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5024 v110 = (*v84)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 (*v84)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026 (signed int)((pParty->uFallStartY - v81) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 v85 = (*v84)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 v110 = 20 - (*v84)->_48EA1B_get_static_effect(v85);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5030 (*v84)->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 while ( (signed int)v84 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 v82 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037 pParty->uFallStartY = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 if ( v102 && v82 < v109 && (signed int)(pParty->uPartyHeight + v82) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041 pParty->vPosition.y = v82 + pParty->uPartyHeight - v109 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042 pParty->field_6F0 = v82 + pParty->uPartyHeight - v109 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5049
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5050
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051 //----- (0047531C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 bool __fastcall sub_47531C(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, BLVFace *a9, int a10)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 BLVFace *v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 int v11; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 int v12; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 int v13; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 int v14; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 signed __int64 v15; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060 __int16 v16; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 int *v18; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062 int v19; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064 int a9b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065 int a9a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 int a10b; // [sp+3Ch] [bp+24h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5067 signed int a10a; // [sp+3Ch] [bp+24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068 int a10c; // [sp+3Ch] [bp+24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5069
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070 v10 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072 v19 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073 if ( a10 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075 v11 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076 a10b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 a9b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 v12 = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 a9a = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 v13 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 - a5 * v10->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 - v10->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 - a5 * v10->pFacePlane_old.vNormal.z - v10->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 a10c = abs(v13) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091 if ( a10c > abs(v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5092 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5093 LODWORD(v15) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5094 HIDWORD(v15) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5095 v14 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096 a10a = v15 / a9a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 a10a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101 v14 = abs(v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 v16 = a4 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5105 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5106 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5107 HIWORD(a7a) = v16 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5108 if ( !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 v10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5110 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5111 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5112 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5113 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 *v18 = a10a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5116 if ( a10a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5117 *v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5118 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5121 //----- (004754BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 bool __fastcall sub_4754BF(int a1, int *a2, int a3, int a4, int a5, int a6, int a7, int a8, BLVFace *a9, int a10, int a11)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5124 BLVFace *v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125 int v12; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 int v13; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 int v14; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 int v15; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5129 signed __int64 v16; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 __int16 v17; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131 int *v19; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5132 int v20; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5133 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5134 int a1b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5135 int a1a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5136 int a11b; // [sp+40h] [bp+28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5137 signed int a11a; // [sp+40h] [bp+28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5138 int a11c; // [sp+40h] [bp+28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5140 v11 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5141 v19 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 v20 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 if ( a11 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 v12 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5146 a11b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 a1b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5148 v13 = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 a1a = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150 v14 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 - a5 * v11->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 - v11->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5155 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5156 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5157 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5158 - a5 * v11->pFacePlane_old.vNormal.z - v11->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5160 a11c = abs(v14) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 if ( a11c > abs(v13) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 LODWORD(v16) = v14 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 HIDWORD(v16) = v14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 v15 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 a11a = v16 / a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 a11a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 v15 = abs(v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5173 v17 = a4 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5174 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5175 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177 HIWORD(a7a) = v17 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178 if ( !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5179 v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5180 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5181 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 *v19 = a11a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 if ( a11a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 *v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 //----- (00475665) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 signed int __thiscall sub_475665(BLVFace *_this, int a2, __int16 a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5197 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5198 Vec3_short_ *v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5199 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5200 int v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201 signed int v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202 Vec3_short_ *v8; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203 signed int v9; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5204 int v10; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5205 signed int v11; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 Vec3_short_ *v12; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 signed int v13; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5209 int v15; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5210 bool v16; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5211 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5212 signed int v18; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5213 int v19; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5214 signed int v20; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5215 int v21; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5216 signed int v22; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5217 signed __int64 v23; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5218 signed int result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5219 int v25; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5220 int v26; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5221 signed int v27; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5222 signed int v28; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5223 signed int v29; // [sp+30h] [bp+Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5224 signed int v30; // [sp+30h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5225 signed int v31; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5227 v3 = _this->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5228 if ( BYTE1(v3) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5230 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5231 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5232 v27 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5233 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5235 v4 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5236 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5238 v5 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5239 v6 = 2 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5240 word_720C10_intercepts_xs[2 * v28] = _this->pXInterceptDisplacements[v28] + v4[_this->pVertexIDs[v28]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5241 word_720B40_intercepts_zs[2 * v28] = _this->pYInterceptDisplacements[v5] + v4[_this->pVertexIDs[v5]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5242 word_720C10_intercepts_xs[2 * v28++ + 1] = _this->pXInterceptDisplacements[v5 + 1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5243 + v4[_this->pVertexIDs[v5 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5244 word_720B40_intercepts_zs[v6 + 1] = _this->pYInterceptDisplacements[v5 + 1] + v4[_this->pVertexIDs[v5 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5246 while ( v28 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5249 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 if ( BYTE1(v3) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 v7 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5255 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5256 v27 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5257 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5259 v8 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5260 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5262 v9 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5263 v10 = 2 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5264 word_720C10_intercepts_xs[2 * v29] = _this->pXInterceptDisplacements[v29] + v8[_this->pVertexIDs[v29]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5265 word_720B40_intercepts_zs[2 * v29] = _this->pZInterceptDisplacements[v9] + v8[_this->pVertexIDs[v9]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5266 word_720C10_intercepts_xs[2 * v29++ + 1] = _this->pXInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5267 word_720B40_intercepts_zs[v10 + 1] = _this->pZInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5269 while ( v29 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5272 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5274 v26 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5275 v11 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5276 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5277 v27 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5278 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5280 v12 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5281 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5283 v13 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5284 v14 = 2 * v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5285 word_720C10_intercepts_xs[2 * v30] = _this->pYInterceptDisplacements[v30] + v12[_this->pVertexIDs[v30]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5286 word_720B40_intercepts_zs[2 * v30] = _this->pZInterceptDisplacements[v13] + v12[_this->pVertexIDs[v13]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5287 word_720C10_intercepts_xs[2 * v30++ + 1] = _this->pYInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5288 word_720B40_intercepts_zs[v14 + 1] = _this->pZInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5290 while ( v30 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5294 v15 = 2 * _this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5296 word_720C10_intercepts_xs[2 * _this->uNumVertices] = word_720C10_intercepts_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5297 word_720B40_intercepts_zs[v15] = word_720B40_intercepts_zs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 v16 = word_720B40_intercepts_zs[0] >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 if ( v15 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5302 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5304 if ( v31 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5305 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5306 v17 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5307 v18 = word_720B40_intercepts_zs[v25 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5308 if ( v16 ^ v18 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5310 v19 = word_720C10_intercepts_xs[v17 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5311 if ( v19 >= v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5312 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5313 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5314 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5315 v21 = v20 | word_720C10_intercepts_xs[v17] < v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5316 if ( v21 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5318 if ( !v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5319 || (v22 = v19 - word_720C10_intercepts_xs[v17],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5320 LODWORD(v23) = v22 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5321 HIDWORD(v23) = v22 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5322 word_720C10_intercepts_xs[v17]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323 + ((signed int)(((unsigned __int64)(v23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5324 / (v18 - word_720B40_intercepts_zs[v17])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5325 * ((v27 - (signed int)word_720B40_intercepts_zs[v17]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5326 + 32768) >> 16) >= v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5327 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5330 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5331 v16 = v18 >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5333 while ( v25 < v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5334 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5335 if ( v31 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5336 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5337 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5338 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5341 //----- (004759C9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342 bool __fastcall sub_4759C9(BLVFace *a1, int a2, int a3, __int16 a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5345 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346 __int16 v6; // si@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348 __int16 v8; // si@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349 int v9; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350 __int16 v10; // si@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5351 int v11; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352 bool v12; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354 signed int v14; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355 int v15; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356 signed int v16; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5357 int v17; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 signed int v18; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 signed __int64 v19; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 bool result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361 int v21; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 signed int v22; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 int v23; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 signed int v24; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 Vec3_int_ **a4a; // [sp+30h] [bp+Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 Vec3_int_ **a4b; // [sp+30h] [bp+Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367 Vec3_int_ **a4c; // [sp+30h] [bp+Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 signed int a4d; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 v4 = a1->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372 if ( BYTE1(v4) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5374 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 v24 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5376 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 a4a = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5379 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 v5 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 word_720A70_intercepts_xs_plus_xs[2 * v22 + 1] = a1->pXInterceptDisplacements[v22 + 1] + LOWORD((*a4a)[a1->pVertexIDs[v22 + 1]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 word_7209A0_intercepts_ys_plus_ys[v5 + 1] = v6 = a1->pYInterceptDisplacements[v22 + 1] + LOWORD((*a4a)[a1->pVertexIDs[v22 + 1]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5386 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5388 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5393 if ( BYTE1(v4) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5395 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5396 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5397 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5399 a4b = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5400 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5402 v7 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5403 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5404 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5405 word_720A70_intercepts_xs_plus_xs[2 * v22 + 1] = a1->pXInterceptDisplacements[v22 + 1] + LOWORD((*a4b)[a1->pVertexIDs[v22 + 1]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5406 word_7209A0_intercepts_ys_plus_ys[v7 + 1] = v8 = a1->pZInterceptDisplacements[v22 + 1] + LOWORD((*a4b)[a1->pVertexIDs[v22 + 1]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5409 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5412 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5414 v23 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5415 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418 a4c = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5421 v9 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5422 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5423 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5424 word_720A70_intercepts_xs_plus_xs[2 * v22 + 1] = a1->pYInterceptDisplacements[v22 + 1] + LOWORD((*a4c)[a1->pVertexIDs[v22 + 1]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5425 word_7209A0_intercepts_ys_plus_ys[v9 + 1] = v10 = a1->pZInterceptDisplacements[v22 + 1] + LOWORD((*a4c)[a1->pVertexIDs[v22 + 1]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 v11 = 2 * a1->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 a4d = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434 word_720A70_intercepts_xs_plus_xs[2 * a1->uNumVertices] = word_720A70_intercepts_xs_plus_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 word_7209A0_intercepts_ys_plus_ys[v11] = word_7209A0_intercepts_ys_plus_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 v12 = word_7209A0_intercepts_ys_plus_ys[0] >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 if ( v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 if ( a4d >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 v13 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 v14 = word_7209A0_intercepts_ys_plus_ys[v21 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 if ( v12 ^ v14 >= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448 v15 = word_720A70_intercepts_xs_plus_xs[v13 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 if ( v15 >= v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 v17 = v16 | word_720A70_intercepts_xs_plus_xs[v13] < v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454 if ( v17 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 if ( !v17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 || (v18 = v15 - word_720A70_intercepts_xs_plus_xs[v13],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 LODWORD(v19) = v18 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 HIDWORD(v19) = v18 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 word_720A70_intercepts_xs_plus_xs[v13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 + ((signed int)(((unsigned __int64)(v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 / (v14 - word_7209A0_intercepts_ys_plus_ys[v13])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 * ((v24 - (signed int)word_7209A0_intercepts_ys_plus_ys[v13]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 + 32768) >> 16) >= v23) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 ++a4d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 v12 = v14 >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471 while ( v21 < v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473 if ( a4d != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 //----- (00475D85) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 BLVFace *v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 int v5; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 int v6; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 int v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 signed int v9; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 signed __int64 v10; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 Vec3_int_ *v11; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490 int v12; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 Vec3_int_ *v14; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 Vec3_int_ *v15; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 int v16; // [sp+18h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 int v17; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 int a4b; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496 int a4c; // [sp+30h] [bp+Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 signed int a4a; // [sp+30h] [bp+Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 v15 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 if ( BYTE3(a4->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 || (v5 = (unsigned __int64)(a2->x * (signed __int64)a4->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 a4b = (unsigned __int64)(a2->y * (signed __int64)a4->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 v6 = (unsigned __int64)(a2->z * (signed __int64)v4->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 v7 = v5 + v6 + a4b,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 (v16 = v5 + v6 + a4b) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508 || v7 > 0 && !(v4->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 v8 = v4->pFacePlane_old.vNormal.z * a1->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 v9 = -(v4->pFacePlane_old.dist + v8 + a1->y * v4->pFacePlane_old.vNormal.y + a1->x * v4->pFacePlane_old.vNormal.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 if ( v7 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514 if ( v4->pFacePlane_old.dist + v8 + a1->y * v4->pFacePlane_old.vNormal.y + a1->x * v4->pFacePlane_old.vNormal.x < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519 if ( v9 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 a4c = abs(-(v4->pFacePlane_old.dist + v8 + a1->y * v4->pFacePlane_old.vNormal.y + a1->x * v4->pFacePlane_old.vNormal.x)) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 if ( a4c > abs(v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 || (LODWORD(v10) = v9 << 16, HIDWORD(v10) = v9 >> 16, a4a = v10 / v16, v17 = v10 / v16, v17 > *a3 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 || (v11 = v14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 LOWORD(v12) = LOWORD(v14->x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->x) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 HIWORD(v12) = LOWORD(v11->y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->y) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 v4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 LOWORD(v11->z) + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->z) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 *a3 = a4a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 //----- (00475F30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 bool __fastcall sub_475F30(int *a1, BLVFace *a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 BLVFace *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 int v10; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 int v11; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 int v12; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 char v13; // zf@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 int v14; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 signed int v16; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 int v17; // ST20_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 signed __int64 v18; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 int v19; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 int *v21; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 int v22; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555 int v23; // [sp+1Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 signed int v24; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 if ( BYTE3(a2->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561 || (v10 = (unsigned __int64)(a6 * (signed __int64)a2->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 v11 = (unsigned __int64)(a7 * (signed __int64)a2->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563 v12 = (unsigned __int64)(a8 * (signed __int64)a2->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 v13 = v10 + v12 + v11 == 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 v14 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566 v22 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 v13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 || v14 > 0 && !(a2->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 v15 = a4 * a2->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 v16 = -(a2->pFacePlane_old.dist + v15 + a3 * a2->pFacePlane_old.vNormal.x + a5 * a2->pFacePlane_old.vNormal.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 if ( v14 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 if ( a2->pFacePlane_old.dist + v15 + a3 * a2->pFacePlane_old.vNormal.x + a5 * a2->pFacePlane_old.vNormal.z < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 if ( v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 v17 = abs(-(a2->pFacePlane_old.dist + v15 + a3 * a2->pFacePlane_old.vNormal.x + a5 * a2->pFacePlane_old.vNormal.z)) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583 if ( v17 > abs(v14)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 || (LODWORD(v18) = v16 << 16, HIDWORD(v18) = v16 >> 16, v24 = v18 / v22, v23 = v18 / v22, v23 > *v21 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 || (LOWORD(v19) = a3 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a6) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586 HIWORD(v19) = a4 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a7) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 a9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 a5 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a8) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 *v21 = v24 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 //----- (004760D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 PartyAction ActionQueue::Next()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 if (!uNumActions)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 return PARTY_INVALID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 auto result = pActions[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 for (unsigned int i = 0; i < uNumActions - 1; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 pActions[i] = pActions[i + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 --uNumActions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 //----- (00476387) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 bool __cdecl sub_476387()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 return (pNPCStats->pNewNPCData[57].uFlags & 0x80) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 //----- (00476395) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 signed int v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 char *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5627
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 if ( bNoNPCHiring == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 if ( (signed int)pNPCStats->uNumNewNPCs <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 if ( pParty->pHirelings[0].uProfession != uProfession )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 LOBYTE(result) = pParty->pHirelings[1].uProfession == uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 v3 = (char *)&pNPCStats->pNewNPCData[0].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 while ( *((int *)v3 + 4) != uProfession || !(*v3 & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5647 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648 if ( v2 >= (signed int)pNPCStats->uNumNewNPCs )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5651 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5653 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 // 6BE3C5: using guessed type char bNoNPCHiring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5657
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658 //----- (004763E0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 void __cdecl InitializeAwards()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 char v2; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664 char *v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 int v4; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5666 signed int v5; // [sp+Ch] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667 char *v6; // [sp+10h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5668 Award *v7; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5670 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 if ( pAwardsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5672 pAllocator->FreeChunk(pAwardsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673 pAwardsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5674 pAwardsTXT_Raw = (char *)pEvents_LOD->LoadRaw("awards.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 strtok(pAwardsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5676 v7 = pAwards;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5679 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5680 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5681 v5 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5682 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5684 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5685 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5686 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5688 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5689 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5691 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 v2 = v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 while ( v2 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 v4 = (int)&v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 if ( v1[(int)v3] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5701 *(char *)v4 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5702 if ( v3 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5704 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5706 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 if ( v6 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 v7->pText = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 if ( v6 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 v7->uSort = atoi(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 v1 = (char *)(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721 while ( (signed int)(v6 - 1) <= 2 && (char *)v5 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5724 while ( (signed int)v7 < (signed int)&dword_7241C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 // 7241C8: using guessed type int dword_7241C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 //----- (004764C2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5729 void __cdecl InitializeScrolls()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5736 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5737 const char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5738 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5739
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5740 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741 if ( pScrollsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5742 pAllocator->FreeChunk(pScrollsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5743 pScrollsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5744 pScrollsTXT_Raw = (char *)pEvents_LOD->LoadRaw("scroll.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5745 strtok(pScrollsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5746 v6 = pScrolls;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5747 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5749 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5750 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5751 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5758 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5759 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5761 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5762 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5763 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5764 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5768 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5769 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5770 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 *v6 = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 while ( (signed int)v6 < (signed int)dword_723E80_award_related );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 // 723E80: using guessed type int dword_723E80_award_related[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 //----- (00476590) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 void __cdecl InitializeMerchants()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 char **v1; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 char *v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 char *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 signed int v6; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801 char *v7; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 if ( pMerchantsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 pAllocator->FreeChunk(pMerchantsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 pMerchantsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5807 pMerchantsTXT_Raw = (char *)pEvents_LOD->LoadRaw("merchant.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 strtok(pMerchantsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809 v1 = (char **)pMerchantsRepairPhrases;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812 v7 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5813 v6 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 v2 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 if ( *v2 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5825 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5827 v3 = v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 v5 = (int)&v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5832 if ( v2[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841 if ( v7 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 *(v1 - 14) = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847 if ( v7 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5849 *(v1 - 7) = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5851 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853 if ( v7 == (char *)3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5855 *v1 = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5857 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5859 if ( v7 - 3 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5860 v1[7] = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5865 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5866 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5867 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5868 while ( (signed int)(v7 - 1) <= 4 && (char *)v6 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5869 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5871 while ( (signed int)v1 < (signed int)pMerchantsIdentifyPhrases );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5874 //----- (00476682) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5875 void __cdecl InitializeTransitions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5877 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5878 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5879 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5880 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5881 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5882 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5883 char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5884 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5885
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5886 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5887 if ( pTransitionsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5888 pAllocator->FreeChunk(pTransitionsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5889 pTransitionsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5890 pTransitionsTXT_Raw = (char *)pEvents_LOD->LoadRaw("trans.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5891 strtok(pTransitionsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5892 v6 = pTransitionStrings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5893 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5895 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5896 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5897 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5898 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5900 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5901 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5902 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5904 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5905 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5907 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5908 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5909 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5910 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5911 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5912 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5914 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5915 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5916 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5917 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5918 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5920 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5922 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5924 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5925 *v6 = (char *)RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5927 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5928 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5930 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5931 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5933 while ( (signed int)v6 < (signed int)"awards.txt" );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5935
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5936 //----- (00476750) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5937 void __cdecl InitializeAutonotes()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5939 char *v0; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5940 int v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5941 char *v2; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5942 char v3; // cl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5943 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5944 int v5; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5945 signed int v6; // [sp+0h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5946
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5947 if ( pAutonoteTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5948 pAllocator->FreeChunk(pAutonoteTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5949 pAutonoteTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5950 pAutonoteTXT_Raw = (char *)pEvents_LOD->LoadRaw("autonote.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5951 strtok(pAutonoteTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5952 v0 = (char *)&stru_723720[0].eType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5953 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5955 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5956 v2 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5957 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5958 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5960 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5961 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5962 while ( v3 != 9 && v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5964 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5965 v3 = v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5967 v5 = (int)&v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5968 if ( !v2[v4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5969 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5970 *(char *)v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5971 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5973 if ( v1 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5975 *((int *)v0 - 1) = (int)RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5977 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5979 if ( v1 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5981 if ( _strcmpi(v2, "potion") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5983 if ( _strcmpi(v2, "stat") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5985 if ( _strcmpi(v2, "seer") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5987 if ( _strcmpi(v2, "obelisk") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5988 *(int *)v0 = 5 - (_strcmpi(v2, "teacher") != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5989 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5990 *(int *)v0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5992 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5994 *(int *)v0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5997 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5999 *(int *)v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6002 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6004 *(int *)v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6009 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6011 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6013 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6014 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6016 while ( v1 - 1 <= 2 && !v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6017 v0 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6019 while ( (signed int)v0 < (signed int)&pScrolls[1] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6021 // 723720: using guessed type Autonote stru_723720[195];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6022
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6023 //----- (004768A9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6024 void __cdecl InitializeQuests()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6025 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6026 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6027 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6028 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6029 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6030 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6031 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6032 const char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6033 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6034
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6035 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6036 if ( pQuestsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6037 pAllocator->FreeChunk(pQuestsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6038 pQuestsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6039 pQuestsTXT_Raw = (char *)pEvents_LOD->LoadRaw("quests.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6040 strtok(pQuestsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6041 v6 = pQuestTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6042 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051 if ( *v1 != '\t' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 while ( v3 != '\t' );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 *v6 = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 while ( (signed int)v6 < (signed int)&unk_723714 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6084
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6086
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 //----- (00476977) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 void NPCStats::Initialize2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 char *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 char *v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 char *v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 char v5; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096 int v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 char *v8; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 char v10; // dl@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 char *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 int v12; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 char *v13; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 char *v14; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 char v15; // dl@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 int v16; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 int v17; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 char v18; // zf@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 NPCStats_stru0 *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 signed int v20; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 signed int v21; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 char *v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112 char *v23; // [sp+10h] [bp-10h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113 char *v24; // [sp+10h] [bp-10h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114 char *v25; // [sp+14h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115 char *v26; // [sp+14h] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 signed int v27; // [sp+14h] [bp-Ch]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6117 signed int v28; // [sp+18h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6118 signed int v29; // [sp+18h] [bp-8h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6119 signed int v30; // [sp+18h] [bp-8h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6120 char *v31; // [sp+1Ch] [bp-4h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6122 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6123 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6124 if ( this->pNPCTextTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6125 pAllocator->FreeChunk(this->pNPCTextTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6126 v1->pNPCTextTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6127 v3 = (char *)pEvents_LOD->LoadRaw("npctext.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6128 v1->pNPCTextTXT_Raw = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6129 strtok(v3, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6130 v28 = (signed int)&unk_72166C_pNPCText;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6131 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6133 v4 = strtok(v2, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6134 v22 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6135 v25 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6136 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 if ( *v4 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6142 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6144 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6145 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6146 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6147 v5 = v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 v7 = (int)&v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6153 if ( !v4[(int)v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6154 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6155 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6156 if ( v6 == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6158 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6160 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 if ( v22 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 *(int *)v28 = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6166 v4 = (char *)(v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6168 while ( (signed int)(v22 - 1) <= 1 && v25 == v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6169 v28 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6171 while ( v28 < (signed int)pQuestTable );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6172 if ( v1->pNPCTopicTXT_Raw != v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 pAllocator->FreeChunk(v1->pNPCTopicTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 v1->pNPCTopicTXT_Raw = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 v8 = (char *)pEvents_LOD->LoadRaw("npctopic.txt", (int)v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 v1->pNPCTopicTXT_Raw = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 strtok(v8, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6178 v29 = (signed int)&unk_721668_pNPCTopic;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6179 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6181 v9 = strtok(v2, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6182 v23 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6183 v26 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6184 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6190 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6192 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6193 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6194 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6195 v10 = v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 while ( v10 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200 v12 = (int)&v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 if ( !v9[(int)v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6202 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6203 *(char *)v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6204 if ( v11 == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6206 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6208 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 if ( v23 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 *(int *)v29 = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6216 while ( (signed int)(v23 - 1) <= 1 && v26 == v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6217 v29 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6219 while ( v29 < (signed int)&unk_722880 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6220 if ( v1->pNPCDistTXT_Raw != v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6221 pAllocator->FreeChunk(v1->pNPCDistTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6222 v1->pNPCDistTXT_Raw = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 v13 = (char *)pEvents_LOD->LoadRaw("npcdist.txt", (int)v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 v1->pNPCDistTXT_Raw = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 strtok(v13, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 strtok(v2, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6227 v30 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6228 v31 = &v1->array_16544[0].field_4[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6229 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6231 v14 = strtok(v2, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6232 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6233 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6238 if ( *v14 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6244 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6247 while ( v15 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6248 v2 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6250 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 if ( !v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6256 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6257 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6259 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6260 if ( (signed int)v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262 if ( (signed int)v2 < 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 v1->array_16544[(int)v2].field_4[v30] = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6267 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6269 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6270 *v31 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6271 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6272 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6273 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6274 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6276 while ( (signed int)(v2 - 1) <= 77 && !v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6277 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6278 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6279 if ( v30 < 59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6281 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6282 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6284 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6286 v19 = v1->array_16544;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6287 v20 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6288 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6290 v19->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6291 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6292 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6293 v19->field_0 += v19->field_4[v21++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6294 while ( v21 < 59 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6295 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6296 --v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6298 while ( v20 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6299 if ( v1->pNPCDistTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6301 pAllocator->FreeChunk(v1->pNPCDistTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6302 v1->pNPCDistTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6305
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6306 //----- (00476C60) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6307 void NPCStats::_476C60()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6309 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6310 NPCData *v2; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6311 char **v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6313 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6314 if ( (signed int)this->uNumNewNPCs > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6316 v2 = &this->pNewNPCData[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6317 v3 = this->pNPCNames2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6318 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6320 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6321 v2->pName = *v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6322 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6323 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6325 while ( v1 < (signed int)this->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6327 if ( pParty->pHirelings[0].pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6328 pParty->pHirelings[0].pName = pParty->pHireling1Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6329 if ( pParty->pHirelings[1].pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6330 pParty->pHirelings[1].pName = pParty->pHireling2Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6332
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6333 //----- (00476CB5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6334 void NPCStats::Initialize1()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6336 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6337 char *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6338 char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6339 char *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6340 char v5; // dl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6341 int v6; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6342 char *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6343 char *v8; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6344 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6345 char v10; // dl@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6346 int v11; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6347 int v12; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6348 char *v13; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6349 char *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6350 char v15; // dl@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6351 int v16; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6352 int v17; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6353 char *v18; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6354 char *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6355 char v20; // cl@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6356 int v21; // edi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6357 int v22; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6358 int v23; // [sp+Ch] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6359 signed int v24; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6360 signed int v25; // [sp+10h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6361 signed int v26; // [sp+10h] [bp-10h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6362 signed int v27; // [sp+10h] [bp-10h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6363 char *Str; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6364 NPCGreeting *pGreetings; // [sp+14h] [bp-Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6365 unsigned __int16 *pGroups; // [sp+14h] [bp-Ch]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6366 char **pCatchPhrase; // [sp+14h] [bp-Ch]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6367 signed int v32; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6368 signed int v33; // [sp+18h] [bp-8h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6369 signed int v34; // [sp+18h] [bp-8h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6370 signed int v35; // [sp+18h] [bp-8h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6371 signed int v36; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6372 signed int v37; // [sp+1Ch] [bp-4h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6373 signed int v38; // [sp+1Ch] [bp-4h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6374 signed int v39; // [sp+1Ch] [bp-4h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6375
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6376 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6377 v2 = (char *)pEvents_LOD->LoadRaw("npcdata.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6378 v1->pNPCDataTXT_Raw = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6379 strtok(v2, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6380 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6381 v3 = (char *)&v1->pNPCData[1].house;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6382 Str = (char *)v1->pNPCNames2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6383 v24 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6384 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6386 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6387 v4 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6388 v36 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6389 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6391 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6392 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6393 while ( v5 != 9 && v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6395 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6396 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6398 v23 = (int)&v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6399 if ( !v4[v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6400 v32 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6401 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6402 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6404 switch ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6406 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6407 v7 = RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6408 *((int *)v3 - 5) = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6409 *(int *)Str = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6410 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6411 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6412 *((int *)v3 - 4) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6413 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6414 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6415 *(int *)v3 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6416 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6417 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6418 *((int *)v3 + 1) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6419 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6420 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6421 *((int *)v3 + 2) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6422 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6423 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6424 *((int *)v3 + 3) = *v4 == 121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6425 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6426 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6427 *((int *)v3 + 5) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6428 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6429 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6430 *((int *)v3 + 6) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6431 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6432 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6433 *((int *)v3 + 7) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6435 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6436 *((int *)v3 + 8) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6437 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6438 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6439 *((int *)v3 + 9) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6440 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6441 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 *((int *)v3 + 10) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6443 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6444 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6448 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6449 v4 = (char *)(v23 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6451 while ( v36 + 1 <= 15 && !v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6452 Str += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6453 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6454 --v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 while ( v24 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6457 v1->uNumNewNPCs = 501;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6458 v8 = (char *)pEvents_LOD->LoadRaw("npcgreet.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6459 v1->pNPCGreetTXT_Raw = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6460 strtok(v8, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6461 pGreetings = v1->pNPCGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6462 v25 = 205;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6463 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6465 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6466 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6467 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6468 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6470 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6471 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6472 while ( v10 != 9 && v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6474 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6475 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6477 v12 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6478 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6479 v33 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6480 *(char *)v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6481 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6485 pGreetings->pGreeting1 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6487 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6489 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6490 pGreetings->pGreeting2 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6493 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6494 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6496 while ( v37 <= 2 && !v33 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6497 ++pGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6498 --v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6500 while ( v25 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6501 v13 = (char *)pEvents_LOD->LoadRaw("npcgroup.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6502 v1->pNCPGroupTXT_Raw = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6503 strtok(v13, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6504 pGroups = v1->pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6505 v26 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6506 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6508 v14 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6509 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6510 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6511 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6513 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6514 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6515 while ( v15 != 9 && v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6517 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6518 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6520 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6521 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6522 v34 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6523 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6524 if ( v16 && v38 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6525 *pGroups = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6526 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6527 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6529 while ( v38 <= 1 && !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6530 ++pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6531 --v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6533 while ( v26 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 v18 = (char *)pEvents_LOD->LoadRaw("npcnews.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6535 v1->pNPCNewsTXT_Raw = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 strtok(v18, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6537 pCatchPhrase = v1->pCatchPhrases;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6538 v27 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6539 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6541 v19 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6542 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6543 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6544 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6546 v20 = *v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6548 while ( v20 != 9 && v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6550 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6551 v20 = v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6553 v22 = (int)&v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6554 if ( !v19[v21] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6555 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6556 *(char *)v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6557 if ( v21 && v39 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 *pCatchPhrase = (char *)RemoveQuotes(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6559 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6560 v19 = (char *)(v22 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6562 while ( v39 <= 1 && !v35 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6563 ++pCatchPhrase;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6564 --v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6566 while ( v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6568
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6569 //----- (0047702F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6570 void NPCStats::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6572 NPCStats *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6573 char *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6574 char *v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6575 char *v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6576 char v5; // al@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6577 int v6; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6578 char *v7; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6579 char *v8; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6580 char *v9; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6581 char v10; // dl@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6582 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6583 char v12; // zf@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6584 signed int v13; // [sp+Ch] [bp-14h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 int v14; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6586 int v15; // [sp+10h] [bp-10h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6587 char *v16; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 signed int v17; // [sp+14h] [bp-Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6589 unsigned int v18; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6590 char *v19; // [sp+18h] [bp-8h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6591 signed int v20; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6592 signed int v21; // [sp+1Ch] [bp-4h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6593
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6594 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6595
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6596 Initialize1();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6597 Initialize2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6598
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6599 InitializeQuests();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6600 InitializeAutonotes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6601 InitializeAwards();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6602 InitializeTransitions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6603 InitializeMerchants();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6604 InitializeScrolls();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6605 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6606 v1->field_17FC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6607 v1->pNPCNamesTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6608 v3 = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6609 v1->pNPCNamesTXT_Raw = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6610 strtok(v3, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6611 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6612 v16 = (char *)v1->pNPCNames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6613 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6615 v4 = strtok(v2, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6616 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6617 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6619 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6620 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6621 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6622 if ( *v4 == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6623 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6624 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6626 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6627 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6628 if ( v5 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6629 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6630 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6631 v14 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6632 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6634 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6635 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6637 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 if ( v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6640 if ( v20 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6641 *((int *)v16 + 1) = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6643 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6645 *(int *)v16 = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6648 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6650 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6651 if ( v20 == 1 && !v1->uNumNPCNames[1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6652 v1->uNumNPCNames[1] = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6654 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6655 v4 += v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6657 while ( v20 <= 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6658 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659 v16 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6660 if ( (signed int)v18 >= 540 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6661 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6662 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6664 v1->pNPCProfTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6665 v1->uNumNPCNames[0] = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6666 v7 = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6667 v1->pNPCProfTXT_Raw = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6668 strtok(v7, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6669 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6670 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6671 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6672 v8 = (char *)&v1->pProfessions[0].pJoinText;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6673 v19 = (char *)&v1->pProfessions[0].pJoinText;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6674 v13 = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6675 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6677 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6678 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6679 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6680 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6682 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6683 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6684 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6686 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6688 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6690 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6691 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6693 while ( v10 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6694 v8 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6696 v15 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6697 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6698 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6699 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6702 switch ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 *((int *)v8 - 3) = atoi(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6706 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6707 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 *((int *)v8 - 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6710 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6711 *((int *)v8 - 2) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6714 *(int *)v8 = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717 *((int *)v8 + 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 v9 = (char *)(v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 while ( v21 <= 6 && !v17 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6730 v8 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 v12 = v13-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 v19 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 while ( !v12 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6735 v1->uNumNPCProfessions = 59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6736 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6738 //----- (00477266) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 void NPCStats::Release()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6741 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6742 void *v2; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6743 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6746 pAllocator->FreeChunk(this->pNPCTopicTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6747 v2 = v1->pNPCTextTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6748 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 pAllocator->FreeChunk(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6750 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6751 pAllocator->FreeChunk(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6753 pAllocator->FreeChunk(v1->pNPCProfTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6754 v1->pNPCProfTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6755 pAllocator->FreeChunk(v1->pNPCNamesTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6756 v1->pNPCNamesTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 pAllocator->FreeChunk(v1->pNPCDataTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6758 v1->pNPCDataTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6759 pAllocator->FreeChunk(v1->pNPCDistTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6760 v1->pNPCDistTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6761 v3 = (int)&v1->pNPCGreetTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6762 pAllocator->FreeChunk(v1->pNPCGreetTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763 v1 = (NPCStats *)((char *)v1 + 98296);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6764 *(int *)v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6765 pAllocator->FreeChunk(v1->pNPCData[0].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6766 v1->pNPCData[0].pName = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6769 //----- (0047730C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6770 signed int __stdcall const_1(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6772 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6775
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6776 //----- (0047732C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 int NPCStats::InitializeAdditionalNPCs(NPCData *a2, int a3, int a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6779 NPCStats *v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 signed __int64 v6; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 int v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6782 int v8; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6783 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 unsigned int v10; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 int v11; // edx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6786 int v12; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 int v13; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 int v14; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6789 int v15; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 int v16; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6791 signed int result; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6792 int v18; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 signed int v19; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6794 signed int v20; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6795 int v21; // [sp+24h] [bp+Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6797 v21 = a3 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6798 v5 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6799 v6 = (signed __int64)((double)v21 * -0.33333334);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6800 v7 = *((char *)&unk_4E83B0 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6801 v18 = *((char *)&unk_4E8408 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6802 v8 = rand() % (signed int)this->uNumNPCNames[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6803 a2->uSex = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6804 a2->pName = (char *)*((int *)&v5->pNPCData[0].pName + v7 + 2 * v8 + 19038);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6805 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6806 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6807 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6810 if ( v18 == v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6812 if ( v7 == v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6814 v21 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6818 if ( v7 - v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 v21 = 201;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 switch ( v18 - v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6826 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 if ( v7 == v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6829 v21 = 400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6831 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6833 if ( v7 - v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6834 v21 = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 if ( v7 == v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6840 v21 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6842 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6844 if ( v7 - v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6845 v21 = 530;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6847 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6848 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6849 if ( v7 == v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6851 v21 = 300;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6853 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6855 if ( v7 - v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6856 v21 = 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6858 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6861 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6862 if ( const_1(v18) == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6863 v19 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6864 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6865 if ( v20 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6867 v10 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6868 v19 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6870 if ( v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6871 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6872 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6874 a2->uPortraitID = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6875 a2->uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6876 a2->fame = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6877 v11 = rand() % 100 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6878 if ( v11 >= 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6880 if ( v11 >= 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6882 if ( v11 >= 95 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6884 if ( v11 >= 98 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6885 a2->rep = -600;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6886 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6887 a2->rep = 400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6889 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6891 a2->rep = -300;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6896 a2->rep = 200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6899 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6901 a2->rep = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6903 v12 = (int)((char *)v5 + 64 * a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6904 v13 = rand() % *(int *)(v12 + 91460);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6905 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6906 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6907 v16 = v13 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6908 if ( v16 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6910 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6911 v14 += *(char *)(v12 + v15++ + 91464);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6912 while ( v14 < v16 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6914 a2->uProfession = v15 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6915 a2->house = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6916 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6917 a2->field_24 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6918 a2->joins = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6919 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6921 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6922
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6923 //----- (0047752B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 int __cdecl GetPartyReputation()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6926 DDM_DLV_Header *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 signed int v1; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6929 v0 = &pOutdoor->ddm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6930 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6931 v0 = &pIndoor->dlv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6932 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6933 if ( CheckHiredNPCSpeciality(0x2Du) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934 v1 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935 if ( CheckHiredNPCSpeciality(0x33u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6936 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 if ( CheckHiredNPCSpeciality(0x30u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6939 if ( CheckHiredNPCSpeciality(0x32u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 if ( CheckHiredNPCSpeciality(0x34u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6942 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 return v1 + v0->uReputation;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6947
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 //----- (004775ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 int stru6_stru1_indoor_sw_billboard::_4775ED(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6953 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6955 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6957 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6958 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6960 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6961 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6962 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6963 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6964 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6965 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6966 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6968 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6969 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6970 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6972 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6973 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6974 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6975 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6976 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6978 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6979 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6980 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6981 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6982 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6983 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6984 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6985 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6986 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6987 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6989 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6990 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6992
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6993 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6997 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7000 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7003 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7005 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7006 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7008 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7011 if ( *(float *)(v4 - 15) <= (double)a2 && *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7012 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7013 if ( *(float *)v5 <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7014 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7015 if ( *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7017 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7018 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7019 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7020 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7021 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7024 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7025 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7026 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7028 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7032 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7034 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7037 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7040 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7043 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7048 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7053 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7056 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7057 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7059 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7061 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7064 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7065 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7066 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7068 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7069 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7070 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7071 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7072 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7073 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7074 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7075 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7076 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7077 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7078 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7079 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7080 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7081 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7082 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7083 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7085 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7086 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7088 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7089 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7091 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7094 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7097 //----- (00477927) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7098 int stru6_stru1_indoor_sw_billboard::_477927(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7102 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7104 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7106 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7109 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7112 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7115 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7119 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7126 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7127 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7130 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7134 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7137 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7140 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7141 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7142 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7143 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7145 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7146 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7147 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7148 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7149 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7150 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7152 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7153 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7154 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7155 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7157 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7158 if ( *(float *)(v4 - 15) >= (double)a2 && *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7159 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7160 if ( *(float *)v5 >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7162 if ( *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7164 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7165 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7167 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7168 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7169 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7170 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7171 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7172 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7173 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7174 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7175 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7176 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7177 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7178 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7179 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7180 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7181 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7182 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7183 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7184 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7185 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7186 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7187 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7189 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7190 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7192 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7193 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7195 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7198 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7201 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7202 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7203 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7206 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7208 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7210 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7213 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7216 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7219 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7220 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7223 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7226 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7230 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7231 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7234 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7238 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7241 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7244 //----- (00477C61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 int stru6_stru1_indoor_sw_billboard::sub_477C61()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7247 stru6_stru1_indoor_sw_billboard *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 int v2; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7249 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7250 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7251 double v5; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7252 double v6; // st6@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7253 double v7; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7254 float v8; // ST30_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7255 float v9; // ST24_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7256 double v10; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7257 double v11; // st6@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7258 double v12; // st5@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7259 float v13; // ST24_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7260 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7261 char *v15; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7262 signed int v16; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7263 __int16 v17; // fps@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7264 unsigned __int8 v18; // c2@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 unsigned __int8 v19; // c3@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 double v20; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7267 float v21; // ST18_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7268 float v22; // ST2C_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7269 float v23; // ST34_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 float v24; // ST24_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7271 double v25; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7272 double v26; // st6@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7273 float v27; // ST34_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7274 float v28; // ST30_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7275 int v29; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7276 signed int v31; // [sp+8h] [bp-28h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7277 float v32; // [sp+Ch] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7278 float v33; // [sp+14h] [bp-1Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7279 float v34; // [sp+18h] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7280 float v35; // [sp+1Ch] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7281 float v36; // [sp+20h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7282 float v37; // [sp+24h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7283 float v38; // [sp+24h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7284 float v39; // [sp+28h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7285 float v40; // [sp+28h] [bp-8h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7286 float v41; // [sp+2Ch] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7287 float v42; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7289 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7292 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 if ( v1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295 v3 = (int)&v1->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298 v4 = *(float *)(v3 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299 LODWORD(v37) = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7300 LODWORD(v36) = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7301 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 v5 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 v6 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7305 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7307 v41 = pBLVRenderParams->fSineY * v6 + pBLVRenderParams->fCosineY * v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 v7 = pBLVRenderParams->fSineY * v5 - pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7312 v41 = pBLVRenderParams->fCosineY * v5 - pBLVRenderParams->fSineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 v7 = pBLVRenderParams->fSineY * v5 + pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7315 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 v9 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 v10 = pBLVRenderParams->fCosineNegX * v41 - pBLVRenderParams->fSineNegX * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7318 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 v12 = pBLVRenderParams->fCosineNegX * v9 + pBLVRenderParams->fSineNegX * v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 v42 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324 v39 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 v10 = pBLVRenderParams->fSineY * v39 + pBLVRenderParams->fCosineY * v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 v11 = pBLVRenderParams->fSineY * v42 - pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7330 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 v10 = pBLVRenderParams->fCosineY * v42 - pBLVRenderParams->fSineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7333 v11 = pBLVRenderParams->fSineY * v42 + pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 v12 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7337 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 *(int *)(v3 + 84) = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7340 v14 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 *(float *)(v3 + 76) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 *(int *)(v3 + 88) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7343 *(float *)(v3 + 80) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 v3 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7346 while ( v2 < v1->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7349 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7351 v15 = (char *)&this->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7352 v31 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7353 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7355 v40 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7356 v32 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7357 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7358 v34 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationY) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7359 v16 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7360 LODWORD(v38) = *(int *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7361 v33 = (double)v16 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7362 //UNDEF(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7363 v20 = *((float *)v15 - 1) - (double)pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7364 if ( v19 | v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7366 v27 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367 LODWORD(v35) = *((int *)v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7368 v28 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7369 v25 = v33 * v28 + v34 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7370 v26 = v34 * v28 - v33 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7372 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7374 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7375 v22 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7376 v23 = v33 * v22 + v34 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7377 v24 = *((float *)v15 + 1) - (double)pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378 v25 = v32 * v24 + v40 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7379 v26 = v34 * v22 - v33 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7380 v35 = v40 * v24 - v32 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382 *((int *)v15 + 21) = LODWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383 v29 = *((int *)v15 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 *((float *)v15 + 19) = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385 *((int *)v15 + 22) = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 *((float *)v15 + 20) = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 v15 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 while ( v31 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 v1->field_10 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 //----- (00477F63) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 bool stru6_stru1_indoor_sw_billboard::sub_477F63()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 stru6_stru1_indoor_sw_billboard *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 char *v5; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 int v6; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 float v7; // ST08_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406 signed int v9; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 float v10; // [sp+10h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 v10 = 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 v3 = (double)pBLVRenderParams->field_40 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 v10 = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 v3 = 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 v4 = a1->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 if ( v4 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 v5 = (char *)&a1->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 v6 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7429 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7431 if ( v3 >= *(float *)v5 || *(float *)v5 >= (double)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 if ( v3 < *(float *)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 v5 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 v2->_477927(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 memcpy(&v2->field_14[40], &v2->field_14[20], 16 * v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 _4775ED(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 //----- (0047802A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 int stru6_stru1_indoor_sw_billboard::sub_47802A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 stru6_stru1_indoor_sw_billboard *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 int v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 float v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 double v6; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 double v7; // ST30_8@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 double v8; // st6@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469 double v9; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 char *v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471 float v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472 double v12; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473 double v13; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474 double v14; // st5@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475 signed int v16; // [sp+38h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476 int a6; // [sp+3Ch] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477 int a5; // [sp+40h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489 v4 = (char *)&a1->field_14[42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492 LODWORD(v5) = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493 v6 = (double)pBLVRenderParams->field_40 * 0.000015258789 / *((float *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496 v7 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7497 pGame->pIndoorCameraD3D->Project(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7498 COERCE_UNSIGNED_INT64(v5 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7499 COERCE_UNSIGNED_INT64(*((float *)v4 - 1) + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7500 COERCE_UNSIGNED_INT64(*(float *)v4 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7501 &a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7502 &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7503 *((float *)v4 + 18) = (double)a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504 *((float *)v4 + 19) = (double)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505 *((float *)v4 + 20) = (double)SLODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7507 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7509 *((float *)v4 + 18) = (double)pBLVRenderParams->uViewportCenterX - v6 * *((float *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7510 v8 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7511 v9 = v6 * *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 *((int *)v4 + 20) = LODWORD(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 *((float *)v4 + 19) = v8 - v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 *((int *)v4 + 21) = *((int *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517 && (double)(signed int)pViewport->uViewportZ > *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 && (double)(signed int)pViewport->uViewportY <= *((float *)v4 + 19)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519 && (double)(signed int)pViewport->uViewportW > *((float *)v4 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 while ( v3 < v2->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 v10 = (char *)&a1->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 LODWORD(v11) = *(int *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535 v12 = (double)pOutdoorCamera->int_fov_rad / *(float *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 *((float *)v10 + 20) = (double)pViewport->uScreenCenterX - v12 * *((float *)v10 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 v13 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 v14 = v12 * *((float *)v10 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 *((int *)v10 + 22) = LODWORD(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 *((int *)v10 + 23) = *((int *)v10 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 *((float *)v10 + 21) = v13 - v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 && (double)(signed int)pViewport->uViewportZ > *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544 && (double)(signed int)pViewport->uViewportY <= *((float *)v10 + 21)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545 && (double)(signed int)pViewport->uViewportW > *((float *)v10 + 21) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7546 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7547 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 v10 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7550 while ( v1 < v2->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7553 return v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7555
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7556
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7557
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7558 //----- (004783FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7559 void __cdecl sub_4783FA_construct_global_73D150()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561 char *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562 signed int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7563
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7564 v0 = (char *)&array_73D150[0].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 v1 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7566 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568 *(float *)v0 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7569 v0 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7570 --v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7572 while ( v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7574
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7575
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7576
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7577 //----- (0047840D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7578 char Render::DrawBuildingsD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7580 IndoorCameraD3D *v0; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7581 char result; // al@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7582 Vec3_int_ **v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7583 Vec3_int_ *v3; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7584 ODMFace *pFace; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7585 int v5; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7586 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7587 stru148 *v7; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588 LightmapBuilder *v8; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 int v9; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7590 char v10; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 Texture *pFaceTexture; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7592 signed int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7593 unsigned int v13; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7594 unsigned int v14; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7595 unsigned int v15; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7596 unsigned int v16; // edi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7597 int v17; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7598 int v18; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599 char *v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7600 char *v20; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7601 Vec3_int_ *v21; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7602 int v22; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7603 char *v23; // edi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7604 int v24; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7605 int v25; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7606 int v26; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7607 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7608 int v28; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7609 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7610 double v30; // st7@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7611 LightmapBuilder *v31; // edi@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 signed int v32; // eax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 int v33; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7614 unsigned int v34; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7615 std::string v35; // [sp-18h] [bp-70h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 int v36; // [sp-14h] [bp-6Ch]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7617 RenderVertexSoft *v37; // [sp-10h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 int v38; // [sp-Ch] [bp-64h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7619 LightmapBuilder *v39; // [sp-8h] [bp-60h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7620 int v40; // [sp-4h] [bp-5Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621 std::string *v41; // [sp+Ch] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 Vec3_int_ *v42; // [sp+10h] [bp-48h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623 LightmapBuilder *pLightmapBuilder; // [sp+14h] [bp-44h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7624 float v44; // [sp+18h] [bp-40h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7625 float v45; // [sp+1Ch] [bp-3Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7626 ODMFace *v46; // [sp+20h] [bp-38h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7627 IndoorCameraD3D *v47; // [sp+24h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7628 unsigned int v48; // [sp+28h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7629 int v49; // [sp+2Ch] [bp-2Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7630 int v50; // [sp+30h] [bp-28h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7631 int v51; // [sp+34h] [bp-24h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7632 int v52; // [sp+38h] [bp-20h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7633 int v53; // [sp+3Ch] [bp-1Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7634 Vec3_int_ *v54; // [sp+40h] [bp-18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7635 int a1; // [sp+44h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 Vec3_int_ **v56; // [sp+48h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 int uNumVertices; // [sp+4Ch] [bp-Ch]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7638 int unused; // [sp+50h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7639 int a3; // [sp+57h] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7641 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 MessageBoxW(nullptr, L"D3D version of RenderBuildings called in software!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odbuild.cpp:73", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7645 unused = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 v0 = pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7647 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7648 v47 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 result = LOBYTE(pOutdoor->pBModels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7650 v41 = (std::string *)pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7651 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7653 v2 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 v56 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7655 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7656 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7657 if ( IsBModelVisible(a1, &unused) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 *(v2 - 3) = (Vec3_int_ *)((unsigned int)*(v2 - 3) | 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661 pFace = (ODMFace *)v2[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7662 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7664 v42 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7665 if ( (signed int)v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7666 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7670 v2 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 v56 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 if ( a1 >= (signed int)v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7676 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7678 if ( pFace->uFaceAttributes & 0x2000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7680 v5 = (int)*(v2 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7681 v6 = pFace->pVertexIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7682 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7683 v7 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 v8 = *(LightmapBuilder **)(v5 + 12 * v6 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 *(int *)&v7->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 pLightmapBuilder = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 v9 = pFace->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7688 v10 = (BYTE1(pFace->uFaceAttributes) & 0x40) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 v48 = pFace->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7692 v48 = pTextureFrameTable->GetFrameTexture(v9, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7693 v9 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7695 pFaceTexture = (Texture *)(v9 != -1 ? (int)&pBitmaps_LOD->pTextures[v9] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 v7->pTexture = pFaceTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 v12 = (v9 != -1 ? pBitmaps_LOD->pTextures[v9].uTextureWidth : 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 v49 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 v49 = pFaceTexture->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 v10 = (pFace->uFaceAttributes & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 v45 = 1.0 / (double)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 v44 = 1.0 / (double)v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 *(int *)&v7->flags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 if ( BYTE2(pFace->uFaceAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 HIBYTE(v7->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 v13 = pFace->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 if ( v13 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710 HIBYTE(v7->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7714 if ( v13 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 HIBYTE(v7->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 v14 = pFace->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 if ( BYTE1(v14) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 *(int *)&v7->flags |= 0x2000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 if ( v14 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 HIBYTE(v7->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 v15 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7728 v7->sTextureDeltaU = pFace->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729 v7->sTextureDeltaV = pFace->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 v16 = v15 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 if ( pFace->pFacePlane.vNormal.z && (v40 = pFace->pFacePlane.vNormal.z, abs(v40) >= 59082) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7733 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7734 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7736 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7739 v7->sTextureDeltaV -= v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7740 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 }
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 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7747 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7748 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7750 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7751 v7->sTextureDeltaV += v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7755 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756 if ( BYTE1(v17) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758 v7->sTextureDeltaU -= v16 & v7->pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 if ( BYTE1(v17) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 v7->sTextureDeltaU += v16 & v7->pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 v18 = pFace->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7771 v19 = (char *)&array_73D150[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772 v20 = (char *)pFace->pTextureUIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7773 v51 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 v21 = &(*(v56 - 1))[*((short *)v20 - 20)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 *((float *)v19 - 2) = (double)v21->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 *((float *)v19 - 1) = (double)v21->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7779 *(float *)v19 = (double)v21->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 v19 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 v52 = v7->sTextureDeltaU + *(short *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 *((float *)v19 - 5) = (double)v52 * v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7783 v22 = v7->sTextureDeltaV + *((short *)v20 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7784 v20 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7785 v10 = v51-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786 v52 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787 *((float *)v19 - 4) = (double)v22 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789 while ( !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 v23 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7791 v51 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 *(float *)&pLightmapBuilder = (double)(signed int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795 if ( *(float *)&pLightmapBuilder == *((float *)v23 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797 v47->ViewTransform((RenderVertexSoft *)(v23 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798 if ( *(float *)v23 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 if ( *(float *)v23 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7807 v47->_436BB7_project_and_stuff((RenderVertexSoft *)(v23 - 12), 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7809 v23 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7810 --v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 while ( v51 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813 v18 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815 if ( v53 == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7816 LOBYTE(v7->field_32) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 v24 = pOutdoor->vSunlight.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 v7->pODMFace = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 v7->uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 v7->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 pLightmapBuilder = (LightmapBuilder *)-v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822 v51 = pFace->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 v51 = (unsigned __int64)(-v24 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 v53 = pFace->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 pLightmapBuilder = (LightmapBuilder *)-pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 v53 = (unsigned __int64)(-pOutdoor->vSunlight.y * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 v52 = pFace->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 v52 = (unsigned __int64)(-pOutdoor->vSunlight.z * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 pLightmapBuilder = (LightmapBuilder *)(v51 + v53 + v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 v51 = 20 * (int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 result = 20 - (20 * (signed int)pLightmapBuilder >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 v7->field_58 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 if ( result < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 v7->field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7835 if ( v7->field_58 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 v7->field_58 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 if ( pOutdoorCamera->numStru148s >= 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841 if ( ODMFace::IsBackfaceCulled(pFace, array_73D150, v7) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 LOBYTE(v25) = (char)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 pFace->bVisible = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 v7->uBModelFaceID = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 LOWORD(v25) = (unsigned __int8)v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 v7->uBModelID = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 v27 = 8 * (v25 | (v26 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 LOBYTE(v27) = v27 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 v7->field_50 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7855 v29 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7857 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 v30 = 1.0 / (array_73D150[v28].vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 memcpy(&array_50AC10[v28], &array_73D150[v28], sizeof(array_50AC10[v28]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 --v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 array_50A2B0[v28 + 49].flt_20 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 while ( v29 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 pFace = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 static stru154 static_RenderBuildingsD3D_stru_73C834;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7874 static_RenderBuildingsD3D_byte_73C84C_init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 stru154::stru154(&static_RenderBuildingsD3D_stru_73C834);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7876 atexit(loc_4789D4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7877 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7878
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7879 v40 = (int)pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 pLightmapBuilder = pGame->pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 v31 = pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 pLightmapBuilder->ApplyLights_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883 pDecalBuilder->ApplyDecals_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884 v31->std__vector_000004_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 LOBYTE(v31) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7886 if ( stru_F8AD28.field_AC > 0 || pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 v31 = (LightmapBuilder *)(v50 ? 3 : v49 != 0 ? 5 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889 static_RenderBuildingsD3D_stru_73C834._49B04D(pFace, (BSPVertexBuffer *)v56 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890 if ( pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7892 v40 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 v39 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7895 v37 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7896 v36 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7897 pDecalBuilder->ApplyDecals(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7898 31 - v7->field_58,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7900 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7901 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 array_50AC10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7903 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 (char)v31,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908 if ( stru_F8AD28.field_AC > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909 pLightmapBuilder->ApplyLights(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 &stru_F8AD28,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7911 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 array_50AC10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 0.0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7915 (char)v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 v32 = sr_424CD7(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7919 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 v32 = sr_424EE0_MakeFanFromTriangle(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 v7->uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 OutdoorCamera::Project(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 if ( uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 v33 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 if ( v33 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 if ( BYTE1(v33) & 0x3C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935 v34 = pRenderer->pHDWaterBitmapIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 v34 = pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938 v40 = (int)pBitmaps_LOD->pHardwareTextures[v34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 v40 = (int)pBitmaps_LOD->pHardwareTextures[v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 pRenderer->DrawPolygon(uNumVertices, v7, pFace, (IDirect3DTexture2 *)v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951 v54 = (Vec3_int_ *)((char *)v54 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 v2 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953 ++pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 if ( (signed int)v54 >= (signed int)v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 // 73C84C: using guessed type char static_RenderBuildingsD3D_byte_73C84C_init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 //----- (004789DE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 BSPModel *Render::DrawBuildingsSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 BSPModel *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 unsigned int *v1; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968 int v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7969 int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7970 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974 double v8; // st7@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7975 char *v9; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7976 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7977 double v11; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7978 stru148 *v12; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979 double v13; // st7@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980 double v14; // ST4C_8@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7982 int v16; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7983 int v17; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7984 unsigned __int8 v18; // sf@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7985 unsigned __int8 v19; // of@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 int v20; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 int v21; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 int v22; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 int v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 int v24; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991 Texture *v25; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 int v26; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993 signed int v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 double v28; // st6@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 double v29; // st5@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 int v30; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 int v31; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 double v32; // st4@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 int v33; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 char v34; // zf@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 BSPVertexBuffer *v35; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 unsigned int v36; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 signed int v37; // esi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 int v38; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 signed int v39; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 char *v40; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 double v41; // ST1C_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 double v42; // ST24_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 signed int v43; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 signed int v44; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 int v45; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 signed int v46; // edx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 char *v47; // ecx@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 double v48; // ST34_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 double v49; // ST44_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 int v50; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 signed int v51; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 char *v52; // edx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8019 double v53; // ST3C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8020 double v54; // ST2C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8021 float v55; // [sp+44h] [bp-7Ch]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8022 float v56; // [sp+48h] [bp-78h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 float v57; // [sp+4Ch] [bp-74h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 float v58; // [sp+50h] [bp-70h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 int v59; // [sp+54h] [bp-6Ch]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 int v60; // [sp+58h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 float v61; // [sp+5Ch] [bp-64h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 float v62; // [sp+60h] [bp-60h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 float v63; // [sp+64h] [bp-5Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 float v64; // [sp+68h] [bp-58h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 int v65; // [sp+6Ch] [bp-54h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8032 int v66; // [sp+70h] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 int v67; // [sp+74h] [bp-4Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 int v68; // [sp+78h] [bp-48h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8035 int v69; // [sp+7Ch] [bp-44h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8036 int v70; // [sp+80h] [bp-40h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8037 int v71; // [sp+84h] [bp-3Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8038 float v72; // [sp+88h] [bp-38h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 int v73; // [sp+8Ch] [bp-34h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8040 int v74; // [sp+90h] [bp-30h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8041 int v75; // [sp+94h] [bp-2Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8042 int v76; // [sp+98h] [bp-28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8043 int v77; // [sp+9Ch] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 unsigned int *v78; // [sp+A0h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 int v79; // [sp+A4h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 int a1; // [sp+A8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 int v81; // [sp+ACh] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 int v82; // [sp+B0h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 int v83; // [sp+B4h] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 signed int v84; // [sp+B8h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 int a2; // [sp+BCh] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8053 a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 result = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 v66 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 v1 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 v78 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 if ( IsBModelVisible(a1, &a2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 *(v1 - 3) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 v3 = v1[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 v79 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 v68 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 v1 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 result = (BSPModel *)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 v78 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 if ( a1 >= v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 if ( !(*(char *)(v3 + 29) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 v4 = 3 * *(short *)(v3 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 v5 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 v67 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 v6 = *(int *)(*(v1 - 1) + 4 * v4 + 8) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091 v83 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 v74 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 v7 = *(char *)(v3 + 302);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 v77 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 v8 = (double)v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099 v9 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 v81 = v3 + 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 v83 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 *(float *)&v84 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 v10 = *(int *)(v5 + 4) + 12 * *(short *)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 *((float *)v9 - 3) = (double)*(signed int *)v10 + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 *((float *)v9 - 2) = (double)*(signed int *)(v10 + 4) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 v11 = (double)*(signed int *)(v10 + 8) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 *((float *)v9 - 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 if ( *(float *)&v84 == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 pGame->pIndoorCameraD3D->ViewTransform((RenderVertexSoft *)(v9 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 if ( *(float *)v9 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 if ( *(float *)v9 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 v74 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 pGame->pIndoorCameraD3D->_436BB7_project_and_stuff((RenderVertexSoft *)(v9 - 12), 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 v81 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 v9 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 --v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127 if ( !v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 v5 = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 v7 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 v12 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 *(int *)&v12->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 if ( v82 == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 *(int *)&v12->flags = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 v12->pODMFace = (ODMFace *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 v12->uNumVertices = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 v12->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 v84 = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 v83 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 v82 = -pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 v84 = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 v82 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 v81 = -pOutdoor->vSunlight.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 v84 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 v81 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148 v84 = v83 + v82 + ((unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 v13 = (double)v84 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 if ( v13 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 v13 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 *(float *)&v84 = v13 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 v14 = *(float *)&v84 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 v71 = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 v15 = (int)&v12->field_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 v12->field_58 = 31 - LOBYTE(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 if ( (char)(31 - LOBYTE(v14)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 if ( *(char *)v15 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 *(char *)v15 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 v16 = *(short *)(v3 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 if ( *(char *)(v3 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 v16 = pTextureFrameTable->GetFrameTexture(v16, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164 v17 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 result = (BSPModel *)&pBitmaps_LOD->pTextures[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 v19 = __OFSUB__(pOutdoorCamera->numStru148s, 1999);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 v18 = pOutdoorCamera->numStru148s - 1999 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 v12->pTexture = (Texture *)(v17 != -1 ? (int)result : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 if ( !(v18 ^ v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 if ( !ODMFace::IsBackfaceCulled((ODMFace *)v3, array_73D150, v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 LOBYTE(v20) = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 *(char *)(v3 + 305) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 v12->uBModelFaceID = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 LOWORD(v20) = (unsigned __int8)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 v12->uBModelID = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 v22 = 8 * (v20 | (v21 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 LOBYTE(v22) = v22 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 v12->field_50 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 if ( *(char *)(v3 + 28) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 *(int *)&v12->flags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8191 if ( *(char *)(v3 + 30) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 v23 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 if ( v23 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 if ( v23 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 HIBYTE(v12->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 v24 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 if ( BYTE1(v24) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 HIBYTE(v12->flags) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 if ( v24 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 HIBYTE(v12->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 v25 = v12->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 v27 = v25->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 v84 = v25->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 v28 = 1.0 / (double)v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 v29 = 1.0 / (double)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 if ( v77 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 v30 = v3 + 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 v83 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 v32 = 1.0 / (*(float *)(v31 * 48 + 7590236) + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 memcpy(&array_50AC10[v31], &array_73D150[v31], sizeof(array_50AC10[v31]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 array_50A2B0[v31 + 49].flt_20 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 v84 = v12->sTextureDeltaU + *(short *)(v30 - 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 array_50A2B0[v31 + 49].u = (double)v84 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 v33 = v12->sTextureDeltaV + *(short *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 v30 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 v34 = v83-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 v84 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 array_50A2B0[v31 + 49].v = (double)v33 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 while ( !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 v3 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 static stru154 static_sub_004789DE_stru_73C818; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 static_sub_004789DE_byte_73C830__init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 stru154::stru154(&static_sub_004789DE_stru_73C818);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 pGame->pLightmapBuilder->ApplyLights_OutdoorFace((ODMFace *)v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 if ( stru_F8AD28.field_AC <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 v12->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 v35 = (BSPVertexBuffer *)(v78 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 v12->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 static_sub_004789DE_stru_73C818._49B04D((ODMFace *)v3, v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 v55 = static_sub_004789DE_stru_73C818.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 v56 = static_sub_004789DE_stru_73C818.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 v57 = static_sub_004789DE_stru_73C818.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, v26, (Vec3_float_ *)&v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 v36 = sr_4250FE(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272 v37 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 if ( !v36 || (OutdoorCamera::Project(v36), v38 = sr_4254D2(v37), (v12->uNumVertices = v38) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8275 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 v40 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8282 LODWORD(v64) = *((int *)v40 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8283 v41 = v64 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 v69 = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 dword_50B638[v39] = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 LODWORD(v63) = *(int *)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8287 v42 = v63 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8288 v73 = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8289 v40 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 dword_50B570[v39++] = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 while ( v39 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 if ( v75 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8299 v43 = sr_4252E8(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 v44 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 if ( !v43 || (OutdoorCamera::Project(v43), v45 = sr_4254D2(v44), (v12->uNumVertices = v45) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307 v47 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8308 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8310 LODWORD(v61) = *((int *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 v48 = v61 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 v65 = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 dword_50B638[v46] = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 LODWORD(v58) = *(int *)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315 v49 = v58 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 v59 = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317 v47 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318 dword_50B570[v46++] = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8320 while ( v46 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325 v50 = sr_4254D2(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 v12->uNumVertices = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 sr_sub_4829B9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330 &array_73D150[*(char *)(v3 + 298)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331 &array_73D150[*(char *)(v3 + 299)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332 &array_73D150[*(char *)(v3 + 300)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 v52 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341 LODWORD(v62) = *((int *)v52 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342 v53 = v62 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343 v60 = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344 dword_50B638[v51] = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 LODWORD(v72) = *(int *)v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346 v54 = v72 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 v70 = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348 v52 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 dword_50B570[v51++] = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 while ( v51 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 sr_sub_486B4E_push_outdoor_edges(array_508690, dword_50B638, dword_50B570, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 v1 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 v3 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362 if ( v79 >= v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 // 73C830: using guessed type char static_sub_004789DE_byte_73C830__init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8371
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 //----- (00479089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 BSPModel *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 int v5; // ST28_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 int v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 int v10; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 signed int v11; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 int v12; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 bool result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 unsigned int v14; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 int v15; // [sp+Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 int *v16; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 int v17; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 int v18; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8392 int v19; // [sp+20h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 int angle; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 int v21; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395 int v22; // [sp+28h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 v16 = unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8398 angle = (signed int)(pOutdoorCamera->uCameraFovInDegrees << 11) / 360 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 v14 = uModelID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 v2 = &pOutdoor->pBModels[uModelID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8401 v3 = v2->vBoundingCenter.x - pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8402 v4 = v2->vBoundingCenter.y - pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8403 v5 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8404 v21 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 v18 = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 v17 = v3 * v5 + v4 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 v17 = (unsigned __int64)(v17 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8411 v19 = v4 * v6 - v3 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8412 v7 = abs(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 v8 = abs(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 v9 = sub_4621DA(v8, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 v10 = v14 * 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416 v22 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8417 *v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8418 if ( v9 < pOutdoor->pBModels[v14].sBoundingRadius + 256 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8419 *v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 v15 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 if ( v19 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8422 v11 = ((unsigned __int64)(v15 * (signed __int64)v17) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423 - ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 + ((unsigned __int64)(v15 * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 v12 = v11 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 if ( v22 <= pOutdoorCamera->shading_dist_mist + 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430 if ( abs(v12) > *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v10) + 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8432 result = v12 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8433 LOBYTE(result) = v12 >= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8440 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 //----- (00479295) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 int stru148::_479295()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8453 stru148 *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 ODMFace *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458 int v6; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 int v7; // ST04_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 stru149 *v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8461 Vec3_int_ thisa; // [sp+Ch] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8462 int v11; // [sp+18h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 v2 = this->pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8466 if ( !v2->pFacePlane.vNormal.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8468 v3 = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 v4 = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8470 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 v11 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8473 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475 if ( (v2->pFacePlane.vNormal.x || v2->pFacePlane.vNormal.y) && abs(v2->pFacePlane.vNormal.z) < 59082 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8477 thisa.x = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478 thisa.y = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479 thisa.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480 thisa.Normalize_float();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481 v4 = thisa.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 v3 = thisa.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 v4 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8488 v5 = -65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8489 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490 v6 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8491 v1->sTextureDeltaU = v2->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 v8 = v1->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8494 v1->sTextureDeltaV = v2->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 v8->_48616B(v4, v7, 0, 0, v5, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8498
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499 //----- (00479332) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500 int Render::OnOutdoorRedrawSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8504 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 char v3; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 float v5; // ST34_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508 double v6; // ST24_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8510 unsigned int v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 signed int v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 Vec3_float_ *v10; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 double v11; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 float v12; // ST34_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 double v13; // ST1C_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516 float v14; // [sp+4h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 float v15; // [sp+8h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518 float v16; // [sp+Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520 v14 = (double)pOutdoor->vSunlight.x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8521 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 v1 = (unsigned int)&array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 v15 = (double)pOutdoor->vSunlight.y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 v16 = (double)pOutdoor->vSunlight.z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 if ( v1 > (unsigned int)array_77EC08 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8527 v2 = (char *)&array_77EC08[0].pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 v3 = v2[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 if ( v3 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 v9 = pTerrainNormalIndices[((*((int *)v2 - 9) >> 15) & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 + 2 * ((unsigned __int8)v2[9] + ((unsigned __int8)v2[8] << 7))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537 if ( v9 > (signed int)(uNumTerrainNormals - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 v10 = &pTerrainNormals[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 v11 = -(v16 * v10->z + v15 * v10->y + v14 * v10->x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8544 if ( v11 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 v11 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 v12 = v11 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 v13 = v12 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 v2[4] = 31 - LOBYTE(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 if ( v2[4] < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8555 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 v2 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560 if ( (unsigned int)(v2 - 84) >= v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563 v4 = (double)(signed int)(((unsigned __int64)(**(int **)v2 * (signed __int64)-pOutdoor->vSunlight.x) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564 + ((unsigned __int64)(*(int *)(*(int *)v2 + 4) * (signed __int64)-pOutdoor->vSunlight.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565 + ((unsigned __int64)(*(int *)(*(int *)v2 + 8) * (signed __int64)-pOutdoor->vSunlight.z) >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567 if ( v4 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568 v4 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569 v5 = v4 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8570 v6 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571 v7 = (int)(v2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8572 v2[4] = 31 - LOBYTE(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573 if ( (char)(31 - LOBYTE(v6)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 if ( *(char *)v7 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8576 *(char *)v7 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 if ( *(char *)(*(int *)v2 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 v8 = pTextureFrameTable->GetFrameTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 *((short *)v2 - 4),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581 pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582 *((int *)v2 - 6) = v8 != -1 ? (int)&pBitmaps_LOD->pTextures[v8] : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8591 //----- (00479543) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 void Render::DrawSkyD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596 double v2; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 double v3; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 double v4; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599 double v5; // st4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 double v6; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 char *v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 int v8; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 int v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604 int v10; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 signed __int64 v11; // qax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 double v12; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 int v13; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 int v14; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 int v15; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 int v16; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 signed __int64 v17; // qtt@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612 signed int v18; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 Texture *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614 double v20; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 double v21; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616 double v22; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 unsigned __int8 v23; // sf@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 unsigned __int8 v24; // of@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 stru148 _this; // [sp+14h] [bp-150h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620 double v26; // [sp+120h] [bp-44h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 float v27; // [sp+128h] [bp-3Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 float v28; // [sp+12Ch] [bp-38h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 int v29; // [sp+130h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 int v30; // [sp+134h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 int v31; // [sp+138h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 int v32; // [sp+13Ch] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 int v33; // [sp+140h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628 float v34; // [sp+144h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 int v35; // [sp+148h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 double v36; // [sp+14Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 int v37; // [sp+154h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632 int v38; // [sp+158h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 int v39; // [sp+15Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 int v40; // [sp+160h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 v30 = (signed __int64)((double)(pOutdoorCamera->int_fov_rad * pIndoorCamera->pos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 / ((double)pOutdoorCamera->int_fov_rad + 8192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 + (double)pViewport->uScreenCenterY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 v34 = cos((double)pIndoorCamera->sRotationX * 0.0030664064) * (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 v38 = (signed __int64)((double)pViewport->uScreenCenterY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641 - (double)pOutdoorCamera->int_fov_rad
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 / (v34 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8643 * (sin((double)pIndoorCamera->sRotationX * 0.0030664064)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8644 * (double)-pOutdoorCamera->shading_dist_mist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8645 - (double)pIndoorCamera->pos.z));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8646 _this._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8647 _this.ptr_38->_48694B();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8648 _this.uTileBitmapID = LOWORD(pOutdoor->uSky_TextureID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8649 _this.pTexture = (Texture *)(SLOWORD(pOutdoor->uSky_TextureID) != -1 ? (int)&pBitmaps_LOD->pTextures[SLOWORD(pOutdoor->uSky_TextureID)] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8650 if ( _this.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8652 v0 = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8653 _this.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8654 _this.uNumVertices = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8655 _this.v_18.x = -stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8656 _this.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8657 v1 = stru_5C6E00->SinCos(v0 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8658 v2 = (double)(signed int)pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8659 _this.v_18.z = -v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8660 array_50AC10[0].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8661 v3 = (double)(signed int)pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8662 array_50AC10[0].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8663 array_50AC10[1].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 v4 = (double)v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665 _this.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 _this.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 v28 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 array_50AC10[1].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669 v5 = (double)(signed int)pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 array_50AC10[2].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 v38 = pViewport->uViewportZ - pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 _this.field_24 = 0x2000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 array_50AC10[2].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 array_50AC10[3].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 array_50AC10[3].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 v6 = tan(0.6457717418670654);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 v33 = 65536 / (signed int)(signed __int64)(v36 / v6 + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 if ( (signed int)_this.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8682 v7 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8683 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8685 LODWORD(v27) = *(int *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8686 v26 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 v29 = LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 v38 = _this.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690 v8 = v39 + _this.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691 v39 = v33 * (v30 - LODWORD(v26));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 v35 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 v38 = _this.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8695 HIDWORD(v36) = v39 + _this.ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696 v38 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 v9 = (unsigned __int64)(_this.v_18.z * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 v10 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 v39 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 if ( _this.v_18.x + v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705 v11 = (signed __int64)*((float *)v7 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706 v38 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707 v12 = *(float *)v7 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 v13 = v33 * (pViewport->uScreenCenterX - v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 LODWORD(v34) = -_this.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 v32 = (signed __int64)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 v14 = v33 * (v30 - v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714 v40 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 v37 = abs(SLODWORD(v34) >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 v15 = abs(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719 if ( v37 <= v15 || v32 <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721 if ( v39 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724 v14 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8725 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 v37 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727 v16 = (unsigned __int64)(_this.v_18.z * (signed __int64)v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8729 v14 += v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 v10 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8731 v39 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8732 v38 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8734 LODWORD(v17) = LODWORD(v34) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 HIDWORD(v17) = SLODWORD(v34) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736 v40 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8737 v18 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738 if ( v18 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8739 v18 = pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8740 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8741 v37 = _this.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8742 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 v37 = v35 + ((unsigned __int64)(v37 * (signed __int64)v13) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 v35 = _this.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745 HIDWORD(v36) += (unsigned __int64)(v35 * (signed __int64)v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8746 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 + ((signed int)((unsigned __int64)(v37 * (signed __int64)v18) >> 16) >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8748 v40 = (unsigned __int64)(SHIDWORD(v36) * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8749 v19 = _this.pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8750 HIDWORD(v36) = _this.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8751 v7 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752 v20 = (double)SHIDWORD(v36) * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 HIDWORD(v36) = 224 * pMiscTimer->uTotalGameTimeElapsed + (v40 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 *((float *)v7 - 10) = (double)v35 / v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 v21 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 HIDWORD(v36) = v19->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 v22 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 HIDWORD(v36) = v18 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 v24 = __OFSUB__(v31, _this.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 v23 = ((v31 - _this.uNumVertices) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8762 *((float *)v7 - 9) = v21 / (v22 * 65536.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 *((float *)v7 - 16) = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764 *((float *)v7 - 11) = 1.0 / (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 if ( !(v23 ^ v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8770 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8771 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8772 array_50AC10[0].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8773 array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8774 array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8775 array_50AC10[3].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8776 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8777 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8778 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8779 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8780 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8785
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8787 //----- (00479A53) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8788 void __fastcall sub_479A53(unsigned int uNumVertices, unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8790 BLVFace *pFace; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8791 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8792 PolygonType v4; // al@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8793 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8794 signed __int64 v6; // qax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8795 PolygonType v7; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8796 int v8; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8797 int v9; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 unsigned int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8799 double v11; // st6@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8800 int v12; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8801 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8802 char *v14; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8803 void *v15; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8804 int v16; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8805 int v17; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806 double v18; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8807 signed int v19; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8808 void *v20; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8809 int v21; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8810 int v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8811 signed __int64 v23; // qtt@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8812 double v24; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8813 unsigned __int8 v25; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8814 unsigned __int8 v26; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 Render *v27; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816 double v28; // st7@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 char *v29; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8818 char *v30; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 unsigned __int8 v31; // c0@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 unsigned __int8 v32; // c3@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8821 double v33; // st6@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8822 char *v34; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8823 const void *v35; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8824 int v36; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 const void *v37; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 signed __int64 v38; // qax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 int v39; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8828 int v40; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8829 int v41; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8830 signed __int64 v42; // qtt@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8831 int v43; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 char v44; // zf@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8833 double v45; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834 double v46; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8835 unsigned int v47; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8836 double v48; // st7@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8837 RenderVertexSoft *v49; // ebx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 void *v50; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839 double v51; // st7@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 RenderVertexSoft *v52; // edx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841 void *v53; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 char *v54; // ebx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8843 unsigned int v55; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8844 unsigned int v56; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8845 int v57; // ST10_4@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8846 Texture *v58; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8847 signed int v59; // [sp-4h] [bp-178h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8848 stru148 *v60; // [sp+0h] [bp-174h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8849 IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8850 stru148 v62; // [sp+14h] [bp-160h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8851 unsigned int v63; // [sp+120h] [bp-54h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8852 double v64; // [sp+124h] [bp-50h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853 unsigned int v65; // [sp+128h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 unsigned int v66; // [sp+12Ch] [bp-48h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8855 float v67; // [sp+130h] [bp-44h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8856 __int64 v68; // [sp+134h] [bp-40h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8857 __int64 v69; // [sp+13Ch] [bp-38h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8858 int v70; // [sp+144h] [bp-30h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8859 int X; // [sp+148h] [bp-2Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8860 int v72; // [sp+14Ch] [bp-28h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8861 float v73; // [sp+150h] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8862 unsigned int v74; // [sp+154h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 RenderVertexSoft *v75; // [sp+158h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8864 float v76; // [sp+15Ch] [bp-18h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8865 int v77; // [sp+160h] [bp-14h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8866 int v78; // [sp+164h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8867 void *v79; // [sp+168h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8868 float v80; // [sp+16Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869 const void *v81; // [sp+170h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 pFace = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8872 v65 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8873 v3 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8874 v4 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8875 if ( v4 == POLYGON_InBetweenFloorAndWall || v4 == POLYGON_Floor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8879 v54 = (char *)&array_507D30[0].u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 LODWORD(v80) = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8883 v69 = (GetTickCount() >> 5) - pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8884 *(float *)v54 = (double)v69 + *(float *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8885 *(float *)v54 = *(float *)v54 * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886 v55 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887 v54 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 v44 = LODWORD(v80)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 v68 = pBLVRenderParams->vPartyPos.y + (v55 >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890 *((float *)v54 - 11) = ((double)v68 + *((float *)v54 - 11)) * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8892 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8893 uFaceID = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8895 v56 = 8 * uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 LOBYTE(v56) = 8 * uFaceID | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 v57 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 v58 = pFace->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8899 pRenderer->DrawIndoorPolygon(v3, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], v58, v57, -1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8900 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8902 HIDWORD(v69) = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 HIDWORD(v68) = pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 *(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905 v70 = (signed __int64)((double)(pBLVRenderParams->field_40 * pBLVRenderParams->vPartyPos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 / (((double)pBLVRenderParams->field_40 + 16192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8907 * 65536.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8908 + *(float *)&v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909 v5 = (double)pIndoorCamera->sRotationX * 0.0030664064;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910 *(float *)&v75 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911 v80 = cos(v5) * 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8912 v6 = (signed __int64)(*(float *)&v74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8913 - (double)pBLVRenderParams->field_40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8914 / ((v80 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8915 * 65535.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8916 * (sin(*(float *)&v75) * -16192.0 - (double)SHIDWORD(v68)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8917 v7 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918 if ( v7 == 4 || v7 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8919 v70 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8920 stru_8019C8._48653D(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8921 v62._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8922 v62.uTileBitmapID = pFace->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923 v62.pTexture = (Texture *)((signed __int16)v62.uTileBitmapID != -1 ? (int)&pBitmaps_LOD->pTextures[(signed __int16)v62.uTileBitmapID] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 if ( !v62.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8926 v8 = pBLVRenderParams->sPartyRotX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8927 v62.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8928 v62.uNumVertices = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8929 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930 v62.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931 v62.v_18.x = -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932 v62.v_18.z = -stru_5C6E00->SinCos(v8 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8934 memcpy(&array_507D30[v3], array_507D30, sizeof(array_507D30[v3]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8935 LODWORD(v80) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8936 v62.field_24 = 33554432;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8937 v64 = (double)(signed int)v10 * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938 v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8939 LODWORD(v80) = v62.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8940 v11 = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8941 LODWORD(v80) = v62.pTexture->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8942 v12 = v62.pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8943 v13 = v62.pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8944 v67 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8945 v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8946 v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8947 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8948 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8949 *((float *)&v68 + 1) = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8950 if ( (signed int)v62.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8953 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8954 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8956 v59 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8957 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8959 v14 = (char *)&array_507D30[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8960 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8962 v15 = (void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v14));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8963 LODWORD(v80) = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8965 v16 = v77 + v62.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8966 v77 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 v74 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8968 LODWORD(v80) = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8970 v79 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8971 v75 = (RenderVertexSoft *)(v77 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v15) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974 v17 = v72 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v14 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 v18 = *(float *)v14 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 v19 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 v77 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978 X = (int)((char *)v79 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979 LODWORD(v76) = (signed __int64)v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980 v20 = (void *)(v72 * (v70 - LODWORD(v76)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 v79 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 v21 = abs(v19 >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 if ( v21 <= abs(X) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991 v19 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992 v20 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 v22 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998 v20 = (char *)v20 + v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999 X = v22 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 LODWORD(v23) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 HIDWORD(v23) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9006 v79 = (void *)(v23 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9007 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9008 LODWORD(v80) = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9009 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9010 LODWORD(v76) = v74 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9011 LODWORD(v80) = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9012 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9013 v77 = (unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9014 LODWORD(v73) = (unsigned __int64)((signed int)v75 * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9015 v14 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9016 LODWORD(v80) = v66 + ((signed int)((unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9017 v81 = (char *)v81 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9018 v24 = (double)SLODWORD(v80) * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9019 LODWORD(v80) = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9020 v26 = __OFSUB__((int)v81, v62.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9021 v25 = (signed int)((char *)v81 - v62.uNumVertices) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9022 *((float *)v14 - 10) = v24 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9023 *((float *)v14 - 9) = (double)SLODWORD(v80) * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9024 *((float *)v14 - 11) = 65536.0 / (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9025 if ( !(v25 ^ v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9026 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9027 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9029 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9031 LODWORD(v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9032 v80 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9033 if ( (signed int)v62.uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9035 v28 = (double)SLODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9036 LODWORD(v76) = (int)(char *)array_50AC10 + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9037 v29 = (char *)&array_50AC10[0].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9038 v30 = (char *)&array_507D30[1].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9039 v79 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9040 v81 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9041 v78 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9042 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9044 v31 = v28 < *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9045 v32 = v28 == *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9046 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9047 memcpy(v79, v81, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9048 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9049 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9050 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9051 if ( v31 | v32 || v28 >= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9053 if ( v28 >= *((float *)v30 - 12) || v28 <= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9054 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9055 v33 = (*((float *)v30 - 1) - *((float *)v30 - 13)) * v28 / (*(float *)v30 - *((float *)v30 - 12))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9056 + *((float *)v30 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9058 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9060 v33 = (*((float *)v30 - 13) - *((float *)v30 - 1)) * v28 / (*((float *)v30 - 12) - *(float *)v30)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9061 + *((float *)v30 - 13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9063 *(float *)v29 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9064 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9065 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9066 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9067 *(unsigned int *)LODWORD(v76) = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9068 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9069 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9070 v81 = (char *)v81 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9071 v30 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9072 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9074 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9076 if ( SLODWORD(v73) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9077 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9078 v34 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9079 v65 = v77 >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9080 HIDWORD(v69) = LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9081 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9083 v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v34));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9084 v78 = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9085 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9086 v36 = (int)((char *)v81 + v62.ptr_38->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9087 v81 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9088 v74 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9089 v78 = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9090 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9091 v78 = (int)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9092 v75 = (RenderVertexSoft *)((char *)v81 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9093 v81 = (const void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9094 v78 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9095 v37 = (const void *)(v72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9096 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v34 - 1)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9097 v38 = (signed __int64)(*(float *)v34 - 1.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9098 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9099 LODWORD(v76) = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9100 v39 = v72 * (v70 - v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9101 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9103 v78 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9104 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9105 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9106 v40 = abs(X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9107 if ( abs((signed __int64)v65) <= v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9108 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9109 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9110 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9111 v39 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9112 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9113 v78 = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9114 v41 = (unsigned __int64)(v62.v_18.z * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9115 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9116 v39 += v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9117 X = v41 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118 v81 = (const void *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120 if ( v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122 v79 = (void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 v78 = 2 * LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124 v81 = (const void *)((unsigned __int64)(v62.v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9125 * (signed __int64)(signed int)(signed __int64)(((double)v70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126 - ((double)(2 * LODWORD(v76))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127 - *(float *)v34))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128 * (double)v72)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129 X = (int)((char *)v81 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 LODWORD(v42) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132 HIDWORD(v42) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133 v79 = (void *)(v42 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134 v81 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135 v78 = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 v43 = v74 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 v74 = (unsigned int)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 LODWORD(v76) = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 v78 = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142 v74 = (unsigned __int64)(v43 * v42 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143 v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 v34 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145 v78 = v66 + ((signed int)v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 v44 = HIDWORD(v69)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147 v45 = (double)v78 * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148 v78 = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v42 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149 *((float *)v34 - 10) = v45 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150 *((float *)v34 - 9) = (double)v78 * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151 v46 = (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152 *((float *)v34 - 16) = 0.000015258789 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 *((float *)v34 - 11) = 65536.0 / v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 if ( SLODWORD(v73) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 v48 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9161 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9162 v49 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9163 HIDWORD(v69) = LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166 if ( v48 >= v49->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 v50 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 ++v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171 memcpy(v50, v49, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 --HIDWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176 while ( HIDWORD(v69) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178 v62.uNumVertices = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180 *(float *)&v74 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181 if ( SLODWORD(v73) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 v51 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 v52 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 v80 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189 if ( v51 <= v52->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191 v53 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 memcpy(v53, v52, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 --LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 while ( v80 != 0.0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201 v62.uNumVertices = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 v59 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207 v27->_4A2ED5(v59, v60, v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 //----- (0047A384) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211 void ODM_LoadAndInitialize(const char *pLevelFilename, OutdoorCamera *thisa)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213 int v2; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214 unsigned int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215 MapInfo *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216 int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217 SpawnPointMM7 *v6; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 size_t v7; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 char *v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221 char Source[120]; // [sp+Ch] [bp-84h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 const char *pFilename; // [sp+84h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223 unsigned int v12; // [sp+88h] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224 int v13; // [sp+8Ch] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 pFilename = pLevelFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227 thisa->AllocSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9228 pOutdoorCamera->_485F64();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9229 pWeather->bRenderSnow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9230 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9231 thisa = (OutdoorCamera *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232 GetAlertStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 if ( qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 qword_A750D8 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 v2 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 v4 = &pMapStats->pInfos[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240 v3 = v4->uRespawnIntervalDays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244 v4 = (MapInfo *)thisa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246 day_attrib &= 0xFFFFFFFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247 dword_6BE13C_uCurrentlyLoadedLocationID = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248 pOutdoor->Initialize(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 pFilename,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 (int)&thisa);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255 UpdateActors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 UpdateLayingItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 BYTE1(dword_6BE364_game_settings_1) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 thisa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 if ( thisa == (OutdoorCamera *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265 if ( (signed int)pOutdoor->uNumSpawnPoints > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270 v6 = &pOutdoor->pSpawnPoints[v12 / 0x18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271 if ( pOutdoor->pSpawnPoints[v12 / 0x18].uKind == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272 SpawnEncounter(v4, v6, v5, v5, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 v4->SpawnRandomTreasure(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276 v12 += 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277 if ( v13 >= (signed int)pOutdoor->uNumSpawnPoints )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282 RespawnGlobalDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284 pOutdoor->PrepareDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285 pOutdoor->_47F223_LooksLikeGenerateMonsterLoot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286 pOutdoor->InitalizeActors(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287 pOutdoor->MessWithLUN();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288 v7 = strlen("levels\\");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 strcpy(Source, &pFilename[v7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 strcpy(pOutdoor->pLevelFilename, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 pWeather->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292 pIndoorCamera->sRotationY = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 pIndoorCamera->sRotationX = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294 pOutdoorCamera->RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 pOutdoor->UpdateSunlightVectors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 pOutdoorCamera->int_fov_rad = (signed __int64)pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297 pOutdoorCamera->int_fov_rad_inv = (signed __int64)pIndoorCamera->flt_20_inv_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298 v8 = (char *)&array_77EC08[0].ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 *(int *)v8 = (int)&stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 v8 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 while ( (signed int)v8 < (signed int)&unk_801A00 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 v9 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 *((int *)v9 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309 *(int *)v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310 *((int *)v9 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 v9 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313 while ( (signed int)v9 < (signed int)&unk_801A0C );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9314 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 }
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 //----- (0047A825) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320 bool LevelDecoration::_47A825()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322 bool v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9323 LevelDecoration *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327 if ( pParty->uCurrentHour >= 1 || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 178) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 164)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9334 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 165)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 166)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 167)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 168)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 169)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 170)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 171)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 172)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 173)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9343 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 174)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9344 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 175)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9345 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 176)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 177) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349 LOBYTE(v2->field_2) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353 LOBYTE(v2->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 //----- (0047BC6F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 unsigned __int16 *__fastcall GetBillboardPalette(RenderBillboard *a1, int a2, signed int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 int v6; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 signed int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 signed __int64 v9; // qtt@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 signed int v10; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368 int v11; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 signed __int64 v12; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370 double v13; // ST10_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 int v14; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 signed int v15; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373 signed __int64 v16; // qtt@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 signed int v17; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 int v18; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 float a3a; // [sp+20h] [bp+8h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 return PaletteManager::Get(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 if ( !pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 v14 = day_fogrange_1 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 if ( a3 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 if ( a3 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 LODWORD(v16) = (a3 - v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 HIDWORD(v16) = (a3 - v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 v15 = (unsigned __int64)(27 * v16 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 v15 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 v17 = sub_43F55F(a1, v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 if ( v17 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 if ( !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 v7 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 v11 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 if ( a4 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 LODWORD(v12) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 HIDWORD(v12) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 a3a = (double)(signed int)(((unsigned __int64)(11 * v12 / (pOutdoorCamera->shading_dist_shade << 16)) >> 16) + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9420 v13 = a3a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9421 v10 = sub_43F55F(a1, LODWORD(v13) + v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 if ( v10 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 if ( v10 < a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 v10 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 if ( v10 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 v10 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 if ( pWeather->field_FA0 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 v8 = 67108864;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 v8 = pParty->pPartyBuffs[16].uPower << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 if ( a3 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 if ( a3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 LODWORD(v9) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 HIDWORD(v9) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 v6 = (unsigned __int64)(27 * v9 / v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 v6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 v10 = sub_43F55F(a1, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 if ( v10 > 27 || !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 //----- (0047BEB1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 int __fastcall sr_sub_47BEB1(signed int a1, stru148 *a2, int terrain_gamma, int a4, int *a5, int *a6, int a7, int a8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 stru148 *v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 signed int v9; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 int v10; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 signed int v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 signed int v12; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 signed __int64 v13; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 int *v14; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 int *v15; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 int v16; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 signed __int64 v17; // qtt@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 double v18; // ST10_8@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 double v19; // ST10_8@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 int v20; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 int result; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 int *v22; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 signed int v23; // edx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 signed __int64 v24; // qtt@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 int v25; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 signed int v26; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 float v27; // [sp+28h] [bp+10h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 float v28; // [sp+28h] [bp+10h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 int v29; // [sp+2Ch] [bp+14h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 v8 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 v9 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9500 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9501 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9502 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 *(char *)a8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 if ( a1 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 v26 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 v9 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 v10 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 if ( !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 v14 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 v15 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 *a5 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526 v16 = v8->field_58 - terrain_gamma;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527 if ( v16 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 if ( v16 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 v16 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 v28 = pOutdoor->fFogDensity * 27.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 v19 = v28 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541 v29 = LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 LODWORD(v17) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546 HIDWORD(v17) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547 v27 = (double)(signed int)(((unsigned __int64)(v17 / (pOutdoorCamera->shading_dist_shade << 16) * (31 - *a6)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548 + *a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550 v18 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 v29 = LODWORD(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 *v14 = v16 + v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 v20 = *v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 if ( v16 + v29 > v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 *v14 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557 if ( *v14 < v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 *v14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 if ( *v14 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9560 *v14 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9561 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 if ( v9 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 if ( v9 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9567 v23 = v9 - (day_fogrange_1 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 LODWORD(v24) = v23 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 HIDWORD(v24) = v23 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 v25 = (unsigned __int64)(27 * v24 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 *a5 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 if ( v25 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9583 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586 *a5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 *v22 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593 *a6 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598 *v22 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601 if ( v10 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604 if ( byte_4D864C && BYTE1(pGame->uFlags) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 v11 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 v12 = v11 << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 if ( v9 <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9623 if ( v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9625 LODWORD(v13) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 HIDWORD(v13) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628 *a5 = (unsigned __int64)(27 * v13 / v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 if ( *a5 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 if ( v8->field_32 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9642 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9643 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9644 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9648 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9649 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9651 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9652 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9653 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9654 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 *(char *)a8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9663 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9664
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9665 //----- (0047C178) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9666 void *__fastcall sr_sub_47C178(signed int a1, stru148 *a2, int terrain_gamma, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 int v6; // [sp+4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671 int v7; // [sp+8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676 result = PaletteManager::Get(HIWORD(a2->pTexture->palette));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680 sr_sub_47BEB1(a1, a2, terrain_gamma, a4, &v6, &v7, (int)((char *)&terrain_gamma + 3), (int)((char *)&a4 + 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 result = sr_sub_47C1CA(v4, SBYTE3(a4), v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686 //----- (0047C1CA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 void *__fastcall sr_sub_47C1CA(stru148 *a1, char a2, int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 int v6; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 int a3a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 result = PaletteManager::Get(HIWORD(a1->pTexture->palette));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 v6 = pGame->_44EC23(a1, &a3a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 if ( v6 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 if ( v6 != -1 || a4 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 v7 = HIWORD(v4->pTexture->palette);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 result = PaletteManager::Get_Mist_or_Red_LUT(v7, v6, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 result = PaletteManager::Get_Dark_or_Red_LUT(HIWORD(v4->pTexture->palette), v6, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 //----- (0047C24C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730 unsigned __int16 *__fastcall sr_sub_47C24C_get_palette(BLVFace *a1, int a2, int a3, char a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 int a3a; // [sp+4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 v5 = pGame->_44ED0A(a1, &a3a, 31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 if ( v5 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 a3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 return PaletteManager::Get_Dark_or_Red_LUT(v4, a3, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747 //----- (0047C28C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 char *__fastcall sr_sub_47C28C_get_palette(stru148 *a1, char a2, signed int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 char *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 int a2a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 a2a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 result = (char *)pPaletteManager->field_199600_palettes[HIWORD(a1->pTexture->palette)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 v6 = pGame->_44EC23(a1, &a2a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 a3 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 if ( a3 != -1 || a4 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 v7 = HIWORD(v4->pTexture->palette);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 result = (char *)PaletteManager::_47C30E_get_palette(v7, a2a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 result = (char *)PaletteManager::_47C33F_get_palette(HIWORD(v4->pTexture->palette), a2a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 //----- (0047C370) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 unsigned int __cdecl GetLevelFogColor()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 signed __int64 v1; // qax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 int v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 if ( bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 result = 0xFF258F5Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 if ( pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 v2 = -(pWeather->field_FA0 != 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 result = (v2 & 0xE0E0E1) - 0xE0E0E1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9810 v1 = (signed __int64)((1.0 - pOutdoor->fFogDensity) * 200.0 + pOutdoor->fFogDensity * 31.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9811 result = v1 | (((unsigned int)v1 | (((unsigned int)v1 | 0xFFFFFF00) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 //----- (0047C3D7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 int __fastcall sub_47C3D7_get_fog_related_stuff(int a1, int a2, float a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 int v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828 double v5; // st7@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 signed int v6; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 signed int v7; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 double v8; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832 double v9; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 double v10; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834 float v11; // ST14_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 double v12; // ST08_8@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837 v3 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 if ( pParty->field_1613C || !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 return 0xFF000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 v5 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 if ( a3 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 v8 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851 if ( a3 > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857 v7 = (signed __int64)((a3 - v5) / (v8 - v5) * 216.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 v9 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863 if ( a3 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 v10 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 if ( a3 > v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872 v11 = (a3 - v9) * 216.0 / (v10 - v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874 v7 = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 if ( v7 > v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 v7 = 248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 return (-1 - v7) << 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 //----- (0047C4FC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 signed int __fastcall GetActorTintColor(int a1, int a2, float a3, int a4, RenderBillboard *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 signed int v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 double v9; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 double v10; // ST0C_8@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 int v11; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 signed int v12; // edi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906 double v13; // ST0C_8@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 double v14; // ST0C_8@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 double v15; // st7@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 double v16; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 double v17; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 int v18; // ST14_4@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 double v19; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 signed int v20; // [sp+10h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 float a3a; // [sp+1Ch] [bp+8h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9915 float a3b; // [sp+1Ch] [bp+8h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 float a3c; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 float a3d; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 float a4b; // [sp+20h] [bp+Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 int a4a; // [sp+20h] [bp+Ch]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 float a4c; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921 float a4d; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 int a5a; // [sp+24h] [bp+10h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 return 8 * (31 - a1) | ((8 * (31 - a1) | ((31 - a1) << 11)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 v8 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 return 16711680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 if ( v8 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 v20 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 v9 = (double)v20 * 1024.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 if ( a3 <= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 if ( a3 > 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 a4b = a3 * 216.0 / v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 v10 = a4b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 v6 = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 if ( SLODWORD(v10) > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 if ( a3 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 if ( a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 v6 = 8 * sub_43F55F(a5, v6 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 result = (signed int)0xF8F8F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9977 v11 = 8 * (a1 - v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9978 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9979 if ( v11 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 if ( v11 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 v12 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 a3b = pOutdoor->fFogDensity * 216.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 v14 = a3b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 a4a = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 a3a = (a3 / (double)pOutdoorCamera->shading_dist_shade * 32.0 + 216.0) * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997 v13 = a3a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 a4a = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 v6 = a4a + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 if ( a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 v6 = 8 * sub_43F55F(a5, v6 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 if ( v6 < v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 v6 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 if ( v6 > 8 * pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 v6 = 8 * pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 if ( !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 v15 = (double)(255 - v6) * 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 a3c = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 a4c = v15 * 16.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 v16 = a4c + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 a5a = LODWORD(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 a4d = a3c * 194.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10017 v17 = a4d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 v18 = LODWORD(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 a3d = a3c * 153.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 v19 = a3d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 result = LODWORD(v19) | ((v18 | (a5a << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10023 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 //----- (0047F44B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 int __stdcall WorldPosToGridCellX(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 return (a1 >> 9) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 //----- (0047F458) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10038 int __stdcall WorldPosToGridCellZ(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10040 return 64 - (a1 >> 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044 //----- (0047F469) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 int __stdcall GridCellToWorldPosX(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 return (a1 - 64) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 // 47F469: using guessed type int __stdcall GridCellToWorldPosX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 //----- (0047F476) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 int __stdcall GridCellToWorldPosZ(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 return (64 - a1) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 // 47F476: using guessed type int __stdcall GridCellToWorldPosZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 //----- (0047F4D3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 void __fastcall sub_47F4D3(int band1, int band2, int band3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062 stru220 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10063 double v5; // ST2C_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10064 double v6; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10065 double v7; // [sp+18h] [bp-28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10066 double v8; // [sp+20h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10067 int v9; // [sp+34h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 int v10; // [sp+38h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 signed int band3a; // [sp+48h] [bp+8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 v9 = band2 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 pOutdoorCamera->outdoor_grid_band_3 = band3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073 v10 = band1 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074 v3 = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075 pOutdoorCamera->uPickDepth = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076 v4 = stru_76E5C8; // v4: 0 -> 65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079 band3a = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080 v8 = (double)(signed int)((char *)v4 + 256 - (int)stru_76E5C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081 do // band3a: 0 -> 128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083 v5 = pow((double)band3a, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084 v6 = pow(v8, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 *((float *)&v5 + 1) = sqrt(v6 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086 v7 = *((float *)&v5 + 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 if ( SLODWORD(v7) >= v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089 if ( SLODWORD(v7) >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090 v4->field_0 = ((SLODWORD(v7) >= v3) - 1) & 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092 v4->field_0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096 v4->field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 band3a += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 v4->distance = LOWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 while ( band3a < 65792 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 while ( (signed int)v4 < (signed int)arary_77E5C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110 //----- (004811A3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111 void stru148::_4811A3()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10113 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 pBitmaps_LOD->pHardwareTextures[pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid]],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 pBitmaps_LOD->pHardwareTextures[uTileBitmapID],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 1, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 //----- (00481DB2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 char __fastcall sr_sub_481DB2(RenderVertexSoft *a1, signed int a2, stru148 *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 signed int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132 char *v6; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 double v7; // ST14_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134 double v8; // ST0C_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 char result; // al@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137 if ( a2 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 v3 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 v4 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 a3->ptr_38 = &stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 a3->pTexture = (Texture *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 if ( (signed int)a3->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 v6 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 v7 = *((float *)v6 - 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 dword_50B638[v5] = LODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 v8 = *(float *)v6 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 v6 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 dword_50B570[v5++] = LODWORD(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 while ( v5 < (signed int)a3->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 result = sr_sub_486B4E_push_outdoor_edges(a1, dword_50B638, dword_50B570, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 //----- (00481E55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 void OutdoorCamera::Project(unsigned int uNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169 double v1; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 double v2; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 double v3; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 unsigned int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174 double v6; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 double v7; // st3@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 v1 = (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180 v2 = (double)pViewport->uScreenCenterX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181 v3 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 v5 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 v6 = v1 * array_507D30[v4].flt_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187 v7 = v6 * array_507D30[v4].vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 memcpy(&array_50AC10[v4], &array_507D30[v4], sizeof(array_50AC10[v4]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189 array_50AC10[v4].vWorldViewProjX = v2 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190 array_50AC10[v4].vWorldViewProjY = v3 - v6 * array_507D30[v4].vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 //----- (00481EB7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199 void __cdecl ResetStru148s()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 int v0; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 v0 = pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 if ( pOutdoorCamera->numStru148s > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 v1 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 *((int *)v1 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 *(int *)v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 *((int *)v1 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 v1 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10214 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 while ( v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10220 //----- (00481ED9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 void __cdecl sub_481ED9_MessWithOutdoorCamera()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 stru_8019C8._48616B(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 pOutdoorCamera->numStru148s = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 pOutdoorCamera->uNumEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 pOutdoorCamera->uNumSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10227 pOutdoorCamera->uNumSurfs = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10228 pOutdoorCamera->field_3C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10229 pOutdoorCamera->field_44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 //----- (00481EFA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 bool __fastcall sub_481EFA(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, RenderVertexSoft *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10235 RenderVertexSoft *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 RenderVertexSoft *v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10237 bool v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 bool v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 bool v9; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 bool v10; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 double v11; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 signed int v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 signed int v13; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 signed int v14; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 signed int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 RenderVertexSoft *v17; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10248 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10249 v6 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10250 v17 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 v7 = a1->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 v8 = v5->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10253 v9 = a3->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10254 v10 = a4->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10255 return !(v8 & v9 & v10 & v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10256 && ((v11 = (double)pOutdoorCamera->shading_dist_mist, v11 > v6->vWorldViewPosition.x) ? (v12 = 0) : (v12 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 v11 > v17->vWorldViewPosition.x ? (v13 = 0) : (v13 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 v11 > a3->vWorldViewPosition.x ? (v14 = 0) : (v14 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 v11 > a4->vWorldViewPosition.x ? (v15 = 0) : (v15 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 !(v13 & v14 & v15 & v12));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 //----- (00481FC9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 int __fastcall sub_481FC9(RenderVertexSoft *_ECX, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10268 /*signed int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 __int64 v11; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10270 __int64 v12; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 __int64 v13; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 __int64 v14; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 __asm { fld dword ptr [ecx+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 _ESI = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 _EDX = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 __asm { fcomp dword ptr [esi+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 _EDI = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 __asm { fnstsw ax }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 fld dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 fcomp dword ptr [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10288 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10289 *(int *)&a4->flags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 fld dword ptr [ecx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 fstp [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 fld dword ptr [ecx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 fstp [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 fld dword ptr [ecx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10300 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 fstp [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 fld dword ptr [edx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 fstp [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 fld dword ptr [edx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 fstp [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 fld dword ptr [edx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 fstp [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 fld dword ptr [ecx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 fld dword ptr [ecx+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 fld dword ptr [ecx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 fld dword ptr [edx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 fld dword ptr [edx+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 fld dword ptr [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10322 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10323 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10324 fld st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 fmul st, st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 fild pIndoorCamera->pos.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 fmul st, st(6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 fld st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 fild pIndoorCamera->pos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 fmul st, st(7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 fild pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 fcomp ds:flt_4D84E8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10351 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 if ( __SETP__(HIBYTE(_AX) & 0x41, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10372 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10374 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 _EDI->v_18.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 _EDI->v_18.y = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 _EDI->v_18.z = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 stru148::_486089_normalize_v_18(_EDI);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 fild dword ptr [edi+18h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 fmul dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404 fchs
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 fild dword ptr [edi+1Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 fmul dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 fild dword ptr [edi+20h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 fmul dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416 _EDI->field_24 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 //----- (004823F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 bool __fastcall GetTerrainHeightsAroundParty(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431 unsigned int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 int v6; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10435 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 int v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 int v9; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439 int v11; // [sp+14h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 int v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 v12 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 v2 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445 v3 = WorldPosToGridCellZ(v11) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 dword_76D568_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 dword_76D56C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 dword_76D570_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 dword_76D574_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 dword_76D558_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 dword_76D55C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 dword_76D560_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 dword_76D564_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 dword_76D548_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 dword_76D54C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 dword_76D550_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457 v4 = pOutdoor->DoGetHeightOnTerrain(v2, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 dword_76D554_terrain_cell_world_pos_around_party_y = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 if ( dword_76D548_terrain_cell_world_pos_around_party_y == dword_76D54C_terrain_cell_world_pos_around_party_y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 && dword_76D54C_terrain_cell_world_pos_around_party_y == dword_76D550_terrain_cell_world_pos_around_party_y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 && dword_76D550_terrain_cell_world_pos_around_party_y == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463 v6 = abs(v12 - dword_76D568_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 if ( abs(dword_76D558_terrain_cell_world_pos_around_party_z - v11) >= v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 v7 = dword_76D554_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 v8 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 v9 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472 v7 = dword_76D54C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 v8 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 v9 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 if ( v8 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10480 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 if ( v7 >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 v10 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 if ( v7 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 if ( v8 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 if ( v7 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 return v9 - v10 > 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 //----- (0048257A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504 int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 unsigned int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 unsigned int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 int result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 int v7; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510 int v8; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 int v9; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 int v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 int v11; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 int v12; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 int v13; // [sp+10h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 signed int v14; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517 int v15; // [sp+24h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519 v11 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 v12 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521 v4 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522 v5 = WorldPosToGridCellZ(v12) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 dword_76D538_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 dword_76D53C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10525 dword_76D540_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 dword_76D544_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 dword_76D528_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528 dword_76D52C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529 dword_76D530_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 dword_76D534_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 dword_76D518_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 dword_76D51C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 dword_76D520_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 dword_76D524_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535 *a3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 if ( pOutdoor->ActuallyGetSomeOtherTileInfo(v4, v5) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537 *a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 if ( !a4 && *a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 v14 = -60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 if ( dword_76D518_terrain_cell_world_pos_around_party_y != dword_76D51C_terrain_cell_world_pos_around_party_y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 || dword_76D51C_terrain_cell_world_pos_around_party_y != dword_76D520_terrain_cell_world_pos_around_party_y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 || dword_76D520_terrain_cell_world_pos_around_party_y != dword_76D524_terrain_cell_world_pos_around_party_y )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 v7 = abs(v11 - dword_76D538_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 if ( abs(dword_76D528_terrain_cell_world_pos_around_party_z - v12) >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 v8 = dword_76D524_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 v9 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 v10 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 v15 = v11 - dword_76D544_terrain_cell_world_pos_around_party_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 v13 = v12 - dword_76D534_terrain_cell_world_pos_around_party_z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 v8 = dword_76D51C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 v9 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 v10 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 v15 = dword_76D53C_terrain_cell_world_pos_around_party_x - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 v13 = dword_76D52C_terrain_cell_world_pos_around_party_z - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 result = v14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 + v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 + ((unsigned __int64)(v13 * (signed __int64)((v10 - v8) << 7)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 + ((unsigned __int64)(v15 * (signed __int64)((v9 - v8) << 7)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 result = v14 + dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 //----- (0048276F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 void stru148::_48276F_sr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 float v2; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581 char *v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 float v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 float v6; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 float v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 float v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 int i; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587 int v10; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 RenderVertexSoft *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 RenderVertexSoft *v12; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 RenderVertexSoft *v13; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 int v14; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 RenderVertexSoft *v15; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 double v16; // st6@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 double v17; // st5@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 double v18; // st4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 int v19; // [sp+4h] [bp-2Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 int v20; // [sp+8h] [bp-28h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 int v21; // [sp+Ch] [bp-24h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599 stru148 *v22; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600 float v23; // [sp+14h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601 float v24; // [sp+18h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602 float v25; // [sp+1Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603 float v26; // [sp+20h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604 float v27; // [sp+24h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 float v28; // [sp+28h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 float v29; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 v1 = this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609 v22 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10610 if ( (signed int)v1 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10612 LODWORD(v2) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613 v26 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614 v28 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10615 v3 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616 v27 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617 if ( (signed int)v1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619 v4 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622 if ( *((float *)v4 - 1) < (double)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 LODWORD(v5) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 v25 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626 v26 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10628 if ( *((float *)v4 - 1) > (double)v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10630 LODWORD(v6) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10631 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 v27 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 if ( *(float *)v4 < (double)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636 LODWORD(v7) = *(int *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637 v29 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 v28 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 if ( v3 < *(float *)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642 v3 = *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 v23 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 ++LODWORD(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 v4 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648 while ( SLODWORD(v2) < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 v8 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 if ( LODWORD(v29) == LODWORD(v25) || LODWORD(v29) == LODWORD(v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 v8 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 v29 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 for ( i = 0; i < (signed int)v1; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656 if ( i == LODWORD(v25) || i == LODWORD(v24) || i == LODWORD(v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 v10 = LODWORD(v29)++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 *(&v19 + v10) = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10662 v11 = &array_508690[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 v12 = &array_508690[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664 v13 = &array_508690[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 if ( LODWORD(v29) != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 v11 = array_508690;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10668 v13 = (RenderVertexSoft *)((char *)array_508690 + 16 * (3 * v1 - 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 v12 = &array_508690[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 v28 = array_508690[1].vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 v27 = array_508690[1].vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 v29 = array_508690[1].vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 v26 = v13->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 v25 = v13->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 v24 = v13->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 if ( v24 * v27 - v25 * v29 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 if ( v26 * v29 - v24 * v28 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 if ( v25 * v28 - v26 * v27 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 v14 = v1 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10683 LODWORD(v26) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 if ( v14 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 v15 = &array_508690[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 v16 = v15->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 v17 = v15->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 v18 = v15->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 v13 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 if ( v27 * v18 - v17 * v29 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 if ( v16 * v29 - v18 * v28 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 if ( v28 * v17 - v16 * v27 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 --LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 --v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 while ( SLODWORD(v26) >= 2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 sr_sub_4829B9(v11, v12, v13, v22, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 //----- (004829B9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 stru148 *__fastcall sr_sub_4829B9(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 double v5; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 RenderVertexSoft *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 double v7; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 stru148 *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 double v9; // st6@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 double v10; // st5@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 float v11; // ST0C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 float v12; // ST04_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 double v13; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 float v14; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 float v15; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 float v16; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 float v17; // [sp+1Ch] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 v5 = a2->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 v16 = a3->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 v15 = a2->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 v14 = v6->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 v7 = v16 * v5 - v14 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 v7 = 0.0000001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 v9 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10739 v10 = 1.0 / a1->vWorldViewPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 v11 = 1.0 / a2->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 v12 = 1.0 / v6->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 v13 = (v11 * v16 - v12 * v15) * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 v17 = (v11 * v14 - v12 * v5) * -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 a4->field_C = a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10745 a4->field_10 = a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746 a4->field_0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747 a4->field_8 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 a4->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 //----- (00482A90) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 signed int __cdecl const_1_0()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759 //----- (00482A94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10760 int sr_sub_482A94(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10762 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 int v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774 signed int v13; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775 int v14; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776 signed __int64 v15; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777 stru149 *v16; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778 signed int v17; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779 Texture *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780 unsigned __int16 *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781 stru149 *v20; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10782 signed int v21; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783 int v22; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785 Texture *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786 signed int v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787 signed int v27; // [sp-4h] [bp-A4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788 int v28; // [sp+Ch] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789 int v29; // [sp+10h] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790 stru316 a2; // [sp+14h] [bp-8Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791 stru315 a1; // [sp+3Ch] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792 int v32; // [sp+80h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793 int v33; // [sp+84h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794 int v34; // [sp+88h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795 int v35; // [sp+8Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796 int v36; // [sp+90h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 int v37; // [sp+94h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798 int v38; // [sp+98h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 int X; // [sp+9Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 v37 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809 v7 = v38 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810 v37 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811 v33 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812 v8 = ((unsigned __int64)(v37 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10813 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 v37 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 v9 = v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818 v28 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819 v35 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820 v10 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 v29 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822 v32 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 v11 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 v37 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 v12 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 v13 = -v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828 v36 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 X = ((unsigned __int64)(v37 * (signed __int64)v12) >> 16) + v38 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 if ( !X || (v14 = abs(v13 >> 14), v14 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10831 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 LODWORD(v15) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833 HIDWORD(v15) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834 v38 = v15 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835 v16 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837 v36 = v16->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10838 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 v36 = v33 + ((unsigned __int64)(v36 * (signed __int64)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 v33 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 X = (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10842 v34 += (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10843 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10844 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10845 if ( v38 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10847 if ( v38 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10849 if ( v38 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 v27 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 v27 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859 v17 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 if ( v17 < (signed int)v3->ptr_48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 v17 = (signed int)v3->ptr_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 v18 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874 if ( v17 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 v19 = (unsigned __int16 *)v18->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 if ( v17 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 v19 = (unsigned __int16 *)v18->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 v19 = (unsigned __int16 *)v18->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 v19 = (unsigned __int16 *)v18->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 a1.pTextureLOD = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 X = (unsigned __int64)(v36 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 v20 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 X = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 a1.field_30 = v28 + ((unsigned __int64)(v36 * (signed __int64)v38) >> 16) - v20->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 X = (unsigned __int64)(v34 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 v21 = X - v3->ptr_38->field_28 - v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 a1.field_30 >>= v17 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 a1.field_2C = v21 >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 v35 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 v37 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v38) >> 16) >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 a1.field_4 = (unsigned __int64)(v37 * (signed __int64)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 X = (unsigned __int64)(v37 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 a1.field_0 = -(signed int)((unsigned __int64)(v37 * (signed __int64)v32) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 v22 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 a1.pColorBuffer = &pRenderer->pTargetSurface[v2->field_8 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 HIWORD(v23) = HIWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v2->field_8 + 640 * v22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 LOWORD(v23) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 a1.field_24 = v23 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 v32 = (signed int)v24->uTextureWidth >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 v25 = (signed int)v24->uTextureHeight >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 a1.field_10 = v17 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914 a1.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 a1.field_8 = (v25 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&a2, v2, v38, v3, pOutdoorCamera->building_gamme, 1u, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 //----- (00482E07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 signed int __fastcall sr_sub_482E07(Span *ecx0, unsigned __int16 *pRenderTarget)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 stru149 *v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 int v8; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 int v10; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 unsigned __int64 v12; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 signed __int64 v14; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 int v15; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 signed __int64 v16; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 int v17; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 unsigned __int16 *v18; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 Texture *v19; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10945 Texture *v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 Texture *v21; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 Texture *v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 int v23; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 Texture *v24; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 signed int v25; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 signed int v26; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 char v27; // bl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 stru149 *v28; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10954 stru149 *v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10955 int v30; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10956 int v31; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10957 unsigned int v32; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10958 int v33; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 signed __int64 v34; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10960 signed int v35; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10961 int v36; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10962 stru149 *v37; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10963 int v38; // edi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10964 int v39; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 int v40; // edi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10966 signed __int64 v41; // qtt@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10967 int v42; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10968 stru149 *v43; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10969 int v44; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10970 int v45; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 Span *v46; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10972 stru149 *v47; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10973 stru149 *v48; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10974 int v49; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10975 int v50; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10976 unsigned int v51; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 int v52; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10978 signed __int64 v53; // qtt@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10979 unsigned int v54; // ecx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10980 int v55; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10981 stru149 *v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10982 int v57; // edi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 int v58; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10984 int v59; // edi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10985 signed __int64 v60; // qtt@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10986 int v61; // edx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10987 stru149 *v62; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10988 int v63; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 int v64; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 int v66; // [sp+Ch] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 int v67; // [sp+10h] [bp-B4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 int v68; // [sp+14h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993 int v69; // [sp+18h] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994 int v70; // [sp+1Ch] [bp-A8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995 int v71; // [sp+20h] [bp-A4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 signed int v72; // [sp+24h] [bp-A0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 stru316 a2; // [sp+28h] [bp-9Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 int v74; // [sp+50h] [bp-74h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999 stru315 a1; // [sp+54h] [bp-70h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000 Span *v76; // [sp+98h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001 unsigned __int16 *v77; // [sp+9Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002 int v78; // [sp+A0h] [bp-24h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003 int v79; // [sp+A4h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 int v80; // [sp+A8h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 int v81; // [sp+ACh] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 int X; // [sp+B0h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 int v83; // [sp+B4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 int v84; // [sp+B8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 int v85; // [sp+BCh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010 int v86; // [sp+C0h] [bp-4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012 v85 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013 v3 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014 v4 = pViewport->uScreenCenterY - ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015 v77 = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016 v5 = pOutdoorCamera->int_fov_rad_inv * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11017 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11018 v76 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11019 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11020 v83 = v6->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022 v7 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 v8 = v81 + v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 v83 = v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 v67 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026 v9 = ((unsigned __int64)(v83 * (signed __int64)v5) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028 v71 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029 v83 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 v68 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 v69 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 v72 = -v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 v10 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - ecx0->field_8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035 v11 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 v66 = v81 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037 v83 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 v12 = v10 * (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039 v81 = v12 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 v13 = v66 + (v12 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 v84 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 if ( !v13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 || (X = v72 >> 15, v83 = abs(v13), abs(v72 >> 15) >= v83)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044 || (LODWORD(v14) = v72 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045 HIDWORD(v14) = v72 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 v79 = v14 / v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047 v80 = v10 - v85 * pOutdoorCamera->int_fov_rad_inv,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 v81 = (unsigned __int64)(v80 * (signed __int64)v3->v_18.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 (v84 = v66 + v81) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 || (v15 = abs(v66 + v81), abs(X) >= v15) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 LODWORD(v16) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053 HIDWORD(v16) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054 v70 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 v17 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 a1.field_24 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 if ( v79 >= v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 a1.field_24 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 v18 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062 if ( a1.field_24 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 if ( a1.field_24 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 if ( a1.field_24 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 v84 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 v18 = (unsigned __int16 *)v22->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 v21 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 v18 = (unsigned __int16 *)v21->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085 v18 = (unsigned __int16 *)v20->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 v19 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 v18 = (unsigned __int16 *)v19->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 a1.pTextureLOD = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 v23 = v3->field_5A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 v83 = v3->field_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 v74 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 v78 = v85 >> v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103 v25 = v24->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 v81 = v85 - (v85 >> v23 << v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 v26 = (signed int)v24->uTextureHeight >> v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 a1.field_10 = v84 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 v27 = v84 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11108 a1.field_8 = (v26 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11109 a1.field_C = (v25 >> v84) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11110 if ( v79 >= v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112 v46 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&a2, v76, v70, v3, pOutdoorCamera->building_gamme, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 v47 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 v86 = v47->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 v79 = (unsigned __int64)(v84 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 v48 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 v79 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v70) >> 16) - v48->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 v79 = (unsigned __int64)(v86 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 v49 = ((unsigned __int64)(v86 * (signed __int64)v70) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 a1.field_2C = (v69 + v49) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 v50 = v46->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11133 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 v51 = v50 + pRenderer->uTargetSurfacePitch * v46->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 a1.pDepthBuffer = (unsigned int *)(&pRenderer->pActiveZBuffer[640 * v46->field_A - 1] + v85 + v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 a1.pColorBuffer = &v77[v85 - 1] + v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 v77 = (unsigned __int16 *)v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 v84 = v66 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 if ( v66 + (unsigned int)((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 && (v52 = abs((signed __int64)v66 + ((__int64)((signed int)v77 * (signed __int64)v80) >> 16)), abs((signed __int64)X) < v52) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 LODWORD(v53) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 HIDWORD(v53) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 v86 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 v54 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 v84 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11154 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11156 v84 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 v54 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159 HIWORD(v55) = HIWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160 LOWORD(v55) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 a1.field_24 = v3->field_50 | v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 v77 = (unsigned __int16 *)v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 v77 = (unsigned __int16 *)(v67 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165 v56 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166 v57 = ((unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16) - v56->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 v77 = (unsigned __int16 *)v56->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 v77 = (unsigned __int16 *)(v71 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 v58 = (((v69 + v86 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 a1.field_4 = (((v68 + v57) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 a1.field_0 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 v86 = (unsigned __int64)(v83 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 v59 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 if ( abs(X) < v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 LODWORD(v60) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 HIDWORD(v60) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 v86 = v60 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 HIWORD(v61) = (unsigned int)(v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 LOWORD(v61) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 a1.field_24 = v61 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11220 v62 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11221 v63 = ((unsigned __int64)(v83 * v60 / v84) >> 16) - v62->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11222 v83 = v62->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11223 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225 v64 = (((signed int)(v69 + ((unsigned __int64)(v83 * v60 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 a1.field_4 = (((v68 + v63) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 a1.field_0 = v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&a2, v76, v79, v3, pOutdoorCamera->building_gamme, 1u, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 v28 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253 v86 = v28->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 v85 = (unsigned __int64)(v84 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 v29 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 v85 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v79) >> 16) - v29->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 v85 = (unsigned __int64)(v86 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263 v30 = ((unsigned __int64)(v86 * (signed __int64)v79) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265 a1.field_2C = (v69 + v30) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 v31 = v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 v32 = pRenderer->uTargetSurfacePitch * v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 v86 = v76->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 a1.pColorBuffer = &v77[v86 + v32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v86 + 640 * v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 v80 = v10 - (pOutdoorCamera->int_fov_rad_inv << v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11278 v86 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 v78 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 v85 = (unsigned __int64)(v78 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11283 v84 = v66 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 if ( v66 + (unsigned int)((unsigned __int64)(v78 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 && (v33 = abs((signed __int64)v66 + ((__int64)(v78 * (signed __int64)v80) >> 16)), abs((signed __int64)X) < v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11287 LODWORD(v34) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 HIDWORD(v34) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 v85 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 v35 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 v84 = v34 / v84;
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 v84 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 v35 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 HIWORD(v36) = HIWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 LOWORD(v36) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 a1.field_24 = v3->field_50 | v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 v78 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 v78 = v67 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 v37 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 v38 = ((unsigned __int64)(v78 * (signed __int64)v35) >> 16) - v37->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 v78 = v37->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 v78 = v71 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11308 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11309 v39 = (((v69 + v85 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11310 a1.field_4 = (((v68 + v38) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11311 a1.field_0 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11312 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11318 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11320 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11322 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11324 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 v80 -= pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 --v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 while ( v86 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11341 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 v76 = (Span *)((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 v40 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 if ( abs(X) < v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 LODWORD(v41) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 HIDWORD(v41) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 X = v41 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 HIWORD(v42) = (unsigned int)(v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 LOWORD(v42) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 a1.field_24 = v42 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 v43 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 v44 = ((unsigned __int64)(v83 * v41 / v84) >> 16) - v43->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 v83 = v43->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 v45 = (((signed int)(v69 + ((unsigned __int64)(v83 * v41 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 a1.field_4 = (((v68 + v44) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 a1.field_0 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11378 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11379 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 //----- (004839BD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 signed int __fastcall sr_sub_4839BD(Span *ecx0, unsigned __int16 *pTargetSurface)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406 unsigned int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 stru149 *v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412 int v12; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 int v14; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415 int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 int v16; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 signed int v17; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418 int v18; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419 signed __int64 v19; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11420 int v20; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11421 unsigned __int16 *v21; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 Texture *v22; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11423 Texture *v23; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424 Texture *v24; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425 Texture *v25; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427 int v27; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428 signed int v28; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11429 Texture *v29; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11430 int v30; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 signed int v31; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11432 signed int v32; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 int v34; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 int v35; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436 int v36; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437 int v37; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11438 signed __int64 v38; // qtt@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11439 int v39; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440 int v40; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 stru149 *v41; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 int v42; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 int v43; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11444 int v44; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11445 char v45; // zf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 int v46; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 int v47; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 int v48; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 int v49; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 signed __int64 v50; // qtt@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 int v51; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 int v52; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 int v53; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 stru149 *v54; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 int v55; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 signed int v56; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 int v57; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 unsigned __int64 v58; // qax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 int v60; // [sp+Ch] [bp-BCh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 Span *v61; // [sp+10h] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 int v62; // [sp+14h] [bp-B4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 int v63; // [sp+18h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11463 stru315 a1; // [sp+1Ch] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 stru316 a2; // [sp+60h] [bp-68h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 int v66; // [sp+88h] [bp-40h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11466 int v67; // [sp+8Ch] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11467 int v68; // [sp+90h] [bp-38h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 int v69; // [sp+94h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11469 int v70; // [sp+98h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 int v71; // [sp+9Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 int v72; // [sp+A0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472 int v73; // [sp+A4h] [bp-24h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 int v74; // [sp+A8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11474 int v75; // [sp+ACh] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11475 int v76; // [sp+B0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11476 int v77; // [sp+B4h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 int X; // [sp+B8h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 int v79; // [sp+BCh] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 int v80; // [sp+C0h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480 unsigned int v81; // [sp+C4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 v3 = ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11483 v4 = ecx0->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11484 v5 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 v6 = v4 + pRenderer->uTargetSurfacePitch * ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11486 v61 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 v7 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 a1.pColorBuffer = &pTargetSurface[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 v74 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v4 + 640 * v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 v9 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 v10 = v5->ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11494 v76 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11495 v72 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11496 v81 = (unsigned __int64)(v10 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 v11 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 v12 = v81 + v11->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11499 v72 = v11->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11500 v67 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 v13 = ((unsigned __int64)(v72 * (signed __int64)v9) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 v81 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11503 v70 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 v72 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 v81 = (unsigned __int64)(v72 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11506 v14 = v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11507 v15 = v81 + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 v71 = v5->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 v63 = v5->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 v16 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 v17 = -v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11512 v60 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11514 v81 = (unsigned __int64)(v76 * (signed __int64)v16) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 X = v81 + v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11516 if ( !(v81 + v15) || (v62 = v17 >> 14, v18 = abs(v17 >> 14), v18 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11517 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 LODWORD(v19) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 HIDWORD(v19) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11520 v69 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 v20 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11522 v21 = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11523 a1.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 if ( v20 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 if ( v20 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 if ( v20 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 v25 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534 v75 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535 v21 = (unsigned __int16 *)v25->pLevelOfDetail3;
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 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541 v21 = (unsigned __int16 *)v24->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11547 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 v21 = (unsigned __int16 *)v23->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555 v21 = (unsigned __int16 *)v22->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11558 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11559 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11561 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&a2, v61, v20, v5, pOutdoorCamera->building_gamme, 1u, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11562 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11563 v66 = v74 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11564 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11565 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11566 v72 = v74 - 16 * (v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11567 v76 = v26->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11568 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11569 v74 = v67 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 v76 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11571 v76 = v70 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11572 v81 = (unsigned __int64)(v74 * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 v27 = ((unsigned __int64)(v74 * (signed __int64)v20) >> 16) - v5->ptr_38->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11574 v81 = (unsigned __int64)(v76 * (signed __int64)v69) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 v28 = v63 + ((unsigned __int64)(v76 * (signed __int64)v69) >> 16) - v5->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 v76 = v75 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 v73 = v8 - 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 v30 = (v71 + v27) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580 v31 = v28 >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581 v32 = (signed int)v29->uTextureWidth >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 v74 = (signed __int16)v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 v68 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 v80 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 v33 = (signed int)v29->uTextureHeight >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 v34 = v75 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587 a1.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 v81 = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 a1.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11590 a1.field_C = v80 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 if ( v66 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 v74 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 v80 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 v35 = (unsigned __int64)(v80 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 v36 = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 X = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11601 if ( v35 + v60 && (v80 = abs(v62), v37 = abs(v36), v80 <= v37) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 LODWORD(v38) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11604 HIDWORD(v38) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 v80 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606 v39 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 X = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611 X = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11612 v39 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 HIWORD(v40) = HIWORD(v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615 if ( v39 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 HIWORD(v40) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11617 LOWORD(v40) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11618 a1.field_24 = v5->field_50 | v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11621 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 v41 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11623 v42 = ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v41->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11624 v79 = v41->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11625 v79 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11627 v43 = (v71 + v42) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 v79 = (signed int)(v63 + ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 a1.field_4 = (v43 - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11630 a1.field_0 = (v79 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v68 >> v66));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11632 v44 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 a1.field_2C = v68 + 4 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11638 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&a2, v61, X, v5, pOutdoorCamera->building_gamme, 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 v73 -= 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 v45 = v74-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 v30 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 v68 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 while ( !v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 v31 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648 if ( !v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11649 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11650 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11651 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v31 >> (12 - v75)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 v46 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653 a1.field_2C = v68 + 4 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 v79 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11655 v80 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11656 v47 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11657 v48 = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11658 X = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11659 if ( v47 + v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11660 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11661 v79 = abs(v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11662 v49 = abs(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11663 if ( v79 <= v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665 LODWORD(v50) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 HIDWORD(v50) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11667 v77 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 v51 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669 HIWORD(v52) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11670 if ( v51 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672 LOWORD(v52) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11673 a1.field_24 = v52 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11675 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 HIWORD(v53) = HIWORD(v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678 LOWORD(v53) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 a1.field_24 = v53 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11681 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 v77 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 v67 = (unsigned __int64)(v79 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 v54 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 v55 = v67 - v54->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 v79 = v54->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 v56 = v71 + v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 v71 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 v57 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11691 v79 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 v58 = v57 * (signed __int64)v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11693 v70 = v58 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 LODWORD(v58) = (signed int)(v63 + (v58 >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11695 a1.field_4 = ((v56 >> v76) - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 a1.field_0 = ((signed int)v58 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 a1.field_28 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11706 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11709 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11710 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11711 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11715 //----- (0048408A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11716 signed int sr_sub_48408A_prolly_odm_water_no_waves(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11719 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11721 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11727 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11729 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 int v14; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 signed int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 int v16; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 stru149 *v18; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736 int v19; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 Texture *v20; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11738 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11739 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11740 Texture *v23; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742 stru149 *v25; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 signed int v26; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11744 int v27; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11745 int v28; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 int v29; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747 int v30; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11748 Texture *v31; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 int v32; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11750 int v33; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 int v35; // [sp+Ch] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 int v36; // [sp+10h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 stru316 a2; // [sp+14h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 stru315 a1; // [sp+3Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 int v39; // [sp+80h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 int v40; // [sp+84h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11757 int v41; // [sp+88h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11758 int v42; // [sp+8Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11759 int v43; // [sp+90h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11760 int v44; // [sp+94h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11761
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11762 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11763 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11764 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11767 v42 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 v7 = v44 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11771 v42 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 v39 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 v8 = ((unsigned __int64)(v42 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11774 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11775 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11776 v42 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11777 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778 v9 = v44 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11779 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11780 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 v36 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11784 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11786 v42 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 v14 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788 v15 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11789 v40 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 v16 = ((unsigned __int64)(v42 * (signed __int64)v14) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 v44 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 if ( !v16 || (v43 = abs(v15 >> 14), v43 > abs(v16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794 LODWORD(v17) = v40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795 HIDWORD(v17) = v40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 v43 = v17 / v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 v18 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799 v40 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 v40 = v39 + ((unsigned __int64)(v40 * (signed __int64)v42) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 v39 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 v44 = (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 v19 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805 v41 += (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808 if ( v43 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11812 v21 = (unsigned __int16 *)v20->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11813 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11814 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11817 if ( v43 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11819 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 v21 = (unsigned __int16 *)v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11822 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11824 if ( v43 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11828 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11829 v44 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 v21 = (unsigned __int16 *)v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11836 v23 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11837 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11838 a1.pTextureLOD = (unsigned __int16 *)v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11840 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 v43 = (unsigned __int64)(v40 * (signed __int64)v43) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 v25 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 v43 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11844 a1.field_30 = ((unsigned __int64)(v40 * (signed __int64)v19) >> 16) - v25->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11845 v43 = (unsigned __int64)(v41 * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11846 v26 = ((unsigned __int64)(v41 * (signed __int64)v19) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11847 v27 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11848 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11849 v41 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11850 a1.field_2C = v26 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11851 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11853 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11854 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11855 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11856 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11858 v41 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11859 v42 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v19) >> 16) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11860 a1.field_4 = (unsigned __int64)(v42 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11861 v43 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11862 a1.field_0 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11863 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&a2, v2, v19, v3, pOutdoorCamera->terrain_gamma, 1u, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11864 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 v28 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 v29 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11867 a1.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11868 v30 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11869 a1.pColorBuffer = &pRenderer->pTargetSurface[v30 + pRenderer->uTargetSurfacePitch * v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v30 + 640 * v28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11871 v31 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11872 v32 = ((signed int)v31->uTextureWidth >> v44) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11873 v33 = ((signed int)v31->uTextureHeight >> v44 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11874 a1.field_10 = v44 - v31->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 a1.field_C = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 a1.field_8 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11879 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11880 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11881 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11884 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11886 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11887 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11888 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11889 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11891 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11893
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11895
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11896 //----- (00484442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11897 signed int sr_sub_484442(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11899 int v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11900 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11901 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11902 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11903 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11904 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11905 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11906 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11907 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11908 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11909 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11910 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11911 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11912 signed int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11913 int v15; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11914 signed __int64 v16; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11915 int v17; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11916 int v18; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 signed int v20; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11919 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11920 stru149 *v22; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 signed int v23; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 int v24; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 int v25; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11924 unsigned int *v26; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11925 Texture *v27; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11926 signed int v28; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11927 signed int v29; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11928 signed int v31; // [sp+Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11929 int v32; // [sp+10h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 int v33; // [sp+14h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11931 stru316 v34; // [sp+18h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11932 stru315 v35; // [sp+40h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11933 int v36; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11934 int v37; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11935 int v38; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11936 int v39; // [sp+90h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11937 int v40; // [sp+94h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11938 int v41; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11939
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11940 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11941 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11942 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11943 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11944 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11945 v39 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11946 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11947 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 v7 = v40 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949 v39 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11950 v36 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11951 v8 = ((unsigned __int64)(v39 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11953 v38 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11954 v39 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11955 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11956 v9 = v40 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11957 v32 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11958 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11959 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11960 v33 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11961 v35.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11963 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11964 v41 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11965 v14 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11966 v31 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11967 v15 = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * v12 * (signed __int64)v3->v_18.y) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11968 v37 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11969 if ( !v15 || (v39 = abs(v14 >> 14), v39 > abs(v15)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11970 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11971 LODWORD(v16) = v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 HIDWORD(v16) = v31 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11973 v40 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11974 v17 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11975 v18 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11976 HIWORD(v19) = (unsigned int)(v16 / v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11977 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11978 v35.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11979 v37 = v36 + ((unsigned __int64)(v3->ptr_38->field_10 * (signed __int64)v41) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11980 v36 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11981 v41 = (unsigned __int64)(v36 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11982 v38 += (unsigned __int64)(v36 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11983 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11984 v35.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 if ( v17 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11989 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 v35.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993 if ( v17 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 if ( v17 < mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 v20 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011 v41 = (unsigned __int64)(v37 * (signed __int64)v17) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012 v22 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 v41 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014 v35.field_30 = ((unsigned __int64)(v37 * (signed __int64)v17) >> 16) - v22->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 v23 = ((unsigned __int64)(v38 * (signed __int64)v17) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12016 v24 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017 v35.field_30 >>= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018 v38 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019 v35.field_2C = v23 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022 v35.field_14 = dword_80AA20 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023 v35.field_18 = dword_80AA1C >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024 v35.field_1C = dword_80AA18 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025 v35.field_20 = dword_80AA14 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027 v38 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12028 v39 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v40) >> 16) >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12029 v35.field_4 = (unsigned __int64)(v39 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12030 v41 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12031 v35.field_0 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032 v35.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&v34, v2, v40, v3, pOutdoorCamera->terrain_gamma, 1u, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033 v25 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034 v26 = (unsigned int *)&pRenderer->pActiveZBuffer[v25 + 640 * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035 v35.pColorBuffer = &pRenderer->pTargetSurface[v25 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036 v35.pDepthBuffer = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037 v27 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038 v28 = (signed int)v27->uTextureWidth >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039 v29 = (signed int)v27->uTextureHeight >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040 v35.field_10 = v20 - v27->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 v35.field_C = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 v35.field_8 = (v29 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 sr_sub_485D3E(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048 sr_sub_485C89(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12050 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 sr_sub_4D72EC(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12054 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 sr_sub_4D73DF(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12061 //----- (004847EB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12062 int sr_sub_4847EB(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068 int v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12069 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070 int v7; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12071 stru149 *v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12072 stru149 *v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12073 int v10; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074 int v11; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075 signed int v12; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 int v13; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 signed __int64 v14; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 signed int v16; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 unsigned __int16 *v17; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 stru149 *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 stru149 *v19; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 signed int v20; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084 int v21; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 Texture *v22; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 signed int v23; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 int v24; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 int v25; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089 int v26; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090 int v27; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091 int v28; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 int v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 signed __int64 v30; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 int v31; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 int v32; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 stru149 *v33; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 signed int v34; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 int v35; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 signed int v36; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 signed __int64 v37; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101 signed int v38; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 int v39; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103 int v40; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12104 unsigned __int64 v41; // qax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12105 int v42; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 int v43; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107 signed __int64 v44; // qtt@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 int v45; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12109 int v46; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 stru149 *v47; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 signed int v48; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 int v49; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113 int v50; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12114 unsigned __int64 v51; // qax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12115 int v52; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12116 int v53; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12117 signed __int64 v54; // qtt@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12118 int v55; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12119 int v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12120 stru149 *v57; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12121 signed int v58; // edi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12122 int v59; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12123 Span *v61; // [sp+Ch] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12124 int v62; // [sp+10h] [bp-ACh]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12125 int v63; // [sp+14h] [bp-A8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12126 int v64; // [sp+18h] [bp-A4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12127 int v65; // [sp+1Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12128 signed int v66; // [sp+20h] [bp-9Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12129 signed int v67; // [sp+24h] [bp-98h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12130 int v68; // [sp+28h] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12131 char v69; // [sp+2Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12132 stru315 sr; // [sp+30h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12133 stru316 sr2; // [sp+74h] [bp-48h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12134 int v72; // [sp+9Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12135 int v73; // [sp+A0h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12136 int v74; // [sp+A4h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12137 int v75; // [sp+A8h] [bp-14h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12138 int v76; // [sp+ACh] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12139 int v77; // [sp+B0h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12140 int v78; // [sp+B4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12141 int v79; // [sp+B8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12143 v2 = _this->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12144 v3 = _this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12145 v4 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12146 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12147 v61 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12148 sr.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12149 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12150 v5 = _this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12151 sr.pColorBuffer = &pRenderer->pTargetSurface[v3 + pRenderer->uTargetSurfacePitch * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12152 v68 = texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12153 v69 = texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12154 if ( v5 >= texmapping_terrain_subdivsize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12155 v73 = texmapping_terrain_subdivsize - (v3 & (texmapping_terrain_subdivsize - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12156 v6 = v5 - v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12157 v67 = v6 >> texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12158 v62 = v6 - (v6 >> texmapping_terrain_subdivpow2 << texmapping_terrain_subdivpow2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12159 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12160 v8 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12161 v79 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12162 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12163 v76 = v8->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12164 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12165 v9 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12166 v10 = v78 + v9->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12167 v76 = v9->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12168 v65 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12169 v11 = ((unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12170 + v4->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12171 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12172 v64 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12173 v76 = v4->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12174 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12175 v12 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12176 v63 = v78 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12177 v66 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12178 v78 = (unsigned __int64)(v79 * (signed __int64)v4->v_18.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12179 v74 = v78 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12180 if ( !(v78 + v63) || (v76 = v12 >> 14, v13 = abs(v12 >> 14), v13 > abs(v74)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12181 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12182 LODWORD(v14) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12183 HIDWORD(v14) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12184 v72 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12185 sr.pTextureLOD = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12186 v15 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12187 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12188 if ( v15 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12190 if ( v15 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12192 if ( v15 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12194 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12195 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12196 v16 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12197 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12199 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12201 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12204 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12206 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12207 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12210 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12211 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12212 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12213 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12215 sr.pTextureLOD = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12216 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12217 sr.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&sr2, v61, v15, v4, pOutdoorCamera->terrain_gamma, 1u, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12218 v18 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12219 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12220 v79 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12222 v77 = v65 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 v79 = v4->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 v79 = v64 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12225 v78 = (unsigned __int64)(v77 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12226 v19 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 v78 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 sr.field_30 = ((unsigned __int64)(v77 * (signed __int64)v72) >> 16) - v19->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 v78 = (unsigned __int64)(v79 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12230 v20 = ((unsigned __int64)(v79 * (signed __int64)v72) >> 16) - v4->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231 v21 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12232 sr.field_30 >>= v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233 v78 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12234 sr.field_2C = v20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12235 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237 sr.field_14 = dword_80AA20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12238 sr.field_18 = dword_80AA1C >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12239 sr.field_1C = dword_80AA18 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12240 sr.field_20 = dword_80AA14 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 v22 = v4->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243 v79 = (signed int)v22->uTextureWidth >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12244 v23 = (signed int)v22->uTextureHeight >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12245 v24 = v16 - v22->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12246 sr.field_8 = (v23 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12247 sr.field_10 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12248 sr.field_C = v79 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 if ( v73 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 v25 = v7 - v73 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 v77 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12254 v79 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12255 v27 = (unsigned __int64)(v77 * (signed __int64)v25) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12256 v28 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12257 v74 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12258 if ( !(v27 + v63) || (v77 = abs(v76), v29 = abs(v28), v77 > v29) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260 LODWORD(v30) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12261 HIDWORD(v30) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 v77 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 v31 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 HIWORD(v32) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 if ( v72 <= v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12266 HIWORD(v32) = HIWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 LOWORD(v32) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 sr.field_24 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270 v74 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12271 v74 = v65 + ((unsigned __int64)(v74 * (signed __int64)v26) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12272 v77 = (unsigned __int64)(v74 * (signed __int64)v31) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 v33 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 v34 = ((unsigned __int64)(v74 * (signed __int64)v31) >> 16) - v33->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12276 v74 = v33->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 v74 = v64 + ((unsigned __int64)(v74 * (signed __int64)v26) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12278 v77 = (unsigned __int64)(v74 * (signed __int64)v31) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279 v35 = (v77 - v4->ptr_38->field_28) >> v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 v74 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 v36 = (v34 >> v78) - sr.field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12282 LODWORD(v37) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 HIDWORD(v37) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 v38 = v35 - sr.field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285 sr.field_4 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12286 v75 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 LODWORD(v37) = v38 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12288 HIDWORD(v37) = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12289 v77 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 sr.field_0 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291 sr.field_28 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12302 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306 v39 = v79 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12308 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 v79 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311 v39 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314 while ( v67 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12316 v40 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317 --v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12318 v75 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 v41 = v40 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320 v79 = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321 LODWORD(v41) = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12322 v42 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323 v74 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324 if ( !((int)v41 + v63) || (v75 = abs(v76), v43 = abs(v42), v75 > v43) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12326 LODWORD(v44) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 HIDWORD(v44) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 v73 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329 v45 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12330 HIWORD(v46) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12331 if ( v72 <= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12332 HIWORD(v46) = HIWORD(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12333 LOWORD(v46) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12334 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12335 sr.field_24 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12337 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12338 v79 = (unsigned __int64)(v75 * (signed __int64)v45) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 v47 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12340 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341 v48 = ((unsigned __int64)(v75 * (signed __int64)v45) >> 16) - v47->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 v75 = v47->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343 v75 = v64 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 v79 = (unsigned __int64)(v75 * (signed __int64)v45) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 v49 = (((v79 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 sr.field_4 = ((v48 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 sr.field_0 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12357 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12358 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12359 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12362 sr.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&sr2, v61, v73, v4, pOutdoorCamera->terrain_gamma, 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 v39 -= pOutdoorCamera->int_fov_rad_inv << v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12366 if ( !v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12367 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12368 v50 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12369 v75 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370 v51 = v50 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 v79 = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 LODWORD(v51) = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 v52 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 v74 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 if ( (int)v51 + v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377 v75 = abs(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12378 v53 = abs(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379 if ( v75 <= v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 LODWORD(v54) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 HIDWORD(v54) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 v76 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12384 v55 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385 HIWORD(v56) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 if ( v72 <= v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 HIWORD(v56) = HIWORD(v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12388 LOWORD(v56) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12389 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12390 sr.field_24 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12393 v76 = (unsigned __int64)(v75 * (signed __int64)v55) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 v57 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12396 v58 = ((unsigned __int64)(v75 * (signed __int64)v55) >> 16) - v57->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12397 v75 = v57->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 v75 = v64 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 v76 = (unsigned __int64)(v75 * (signed __int64)v55) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12400 v59 = (((v76 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 sr.field_4 = ((v58 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 sr.field_0 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 sr.field_28 = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12404 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12406 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12407 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12416 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12421 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12423 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 // 6BE050: using guessed type int texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425 // 6BE054: using guessed type int texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 // 6BE0F0: using guessed type int mipmapping_terrain_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 // 6BE0F4: using guessed type int mipmapping_terrain_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 // 6BE0F8: using guessed type int mipmapping_terrain_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12429 // 80AA10: using guessed type char byte_80AA10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12430 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12431 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 //----- (00485407) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 signed int __fastcall sr_sub_485407_prolly_odm_water_wavy(Span *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12440 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 unsigned int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 int v8; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 stru149 *v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 stru149 *v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 signed int v15; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 int v16; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 int v18; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 unsigned __int8 *pLOD; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 Texture *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 Texture *v23; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 stru149 *v25; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 signed int v27; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467 stru149 *v28; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12468 Texture *v29; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 signed int v30; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12470 signed int v31; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12471 signed int v32; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12472 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 int v34; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 int v35; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 unsigned __int64 v36; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476 int v37; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12477 unsigned __int64 v38; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12478 char v39; // cl@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 stru316 a2; // [sp+Ch] [bp-90h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12480 stru315 a1a; // [sp+34h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12481 Span *v43; // [sp+78h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12482 int v44; // [sp+7Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 int v45; // [sp+80h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12484 int v46; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12485 Span *v47; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 int v48; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12487 int v49; // [sp+90h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 int i; // [sp+94h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 int X; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491 v2 = a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492 v3 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493 v4 = v3 + pRenderer->uTargetSurfacePitch * a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12494 v5 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 v43 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 v6 = a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12497 a1a.pColorBuffer = &pRenderer->pTargetSurface[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 v46 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 a1a.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 v9 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 v47 = (Span *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 v48 = v9->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12506 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 v10 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 v11 = X + v10->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509 v48 = v10->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 v12 = ((unsigned __int64)(v48 * (signed __int64)v8) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12513 v45 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 v48 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12515 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12516 v13 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517 v14 = X + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 v15 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 v48 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12520 X = ((unsigned __int64)(v7 * (signed __int64)v13) >> 16) + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 if ( !X || (v16 = abs(v15 >> 14), v16 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523 LODWORD(v17) = v48 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 HIDWORD(v17) = v48 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 i = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 v18 = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 HIWORD(v19) = (unsigned int)(v17 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12528 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529 a1a.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12530 pLOD = v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 a1a.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 if ( v18 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 if ( v18 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12537 if ( v18 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12539 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12540 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12541 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12542 v49 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12543 pLOD = v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12547 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12548 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12549 pLOD = v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12552 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 pLOD = v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 v21 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 pLOD = v21->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 a1a.pTextureLOD = (unsigned __int16 *)pLOD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 if ( !pLOD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 a1a.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(&a2, v43, v18, v5, pOutdoorCamera->terrain_gamma, 1u, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 v43 = (Span *)(v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573 v25 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 v48 = v46 - 16 * (v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 v46 = v25->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 v46 = v44 + ((unsigned __int64)(v46 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 v44 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 v45 += (unsigned __int64)(v44 * (signed __int64)v7) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 X = (unsigned __int64)(v46 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 X = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 v27 = ((unsigned __int64)(v46 * (signed __int64)v18) >> 16) - v26->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 X = (unsigned __int64)(v45 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 v28 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 v44 = bUseLoResSprites + v49 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588 v30 = v27 >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 v31 = (signed int)(((unsigned __int64)(v45 * (signed __int64)v18) >> 16) - v28->field_28) >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 v32 = (signed int)v29->uTextureWidth >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 v33 = (signed int)v29->uTextureHeight >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 v34 = v49 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 a1a.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 X = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 v45 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 a1a.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 a1a.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 i = (unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)i) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 v47 = (Span *)(i >> v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 v36 = (signed int)v47 * (signed __int64)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 i = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 a1a.field_4 = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604 v37 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 v38 = (signed int)v47 * (signed __int64)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 i = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 a1a.field_0 = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 if ( (signed int)v43 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610 v47 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 v39 = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 for ( i = 12 - v49; ; v39 = i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> v39));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 v30 += 16 * a1a.field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 v31 += 16 * a1a.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 v47 = (Span *)((char *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630 i = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> (12 - v49)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 a1a.field_28 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12635 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12636 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 //----- (0048585C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 signed int __fastcall sr_sub_48585C_mb_DrawSpan(Span *a1, unsigned __int16 *pRenderTarget, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12646 Span *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 stru148 *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 signed __int64 v6; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651 signed int v8; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652 void *v9; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653 int v10; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654 unsigned __int16 *pPixels; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 signed int v13; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 int X; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 pPixels = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 v4 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661 v13 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 X = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 * (pViewport->uScreenCenterX - (signed int)a1->field_8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 * (signed __int64)v4->v_18.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 + ((unsigned __int64)(v4->v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667 * (pViewport->uScreenCenterY - (signed int)a1->field_A))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669 if ( X && (v5 = abs(-v4->field_24 >> 14), v5 <= abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671 LODWORD(v6) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 HIDWORD(v6) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 v7 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 v8 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 v7 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 v8 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 v9 = sr_sub_47C178(v8, v4, pOutdoorCamera->terrain_gamma, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682 fill_pixels_fast(*((short *)v9 + v4->pTexture->uDecompressedSize), pPixels, v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 HIWORD(v10) = HIWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684 LOWORD(v10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 j_memset32(v10, &pRenderer->pActiveZBuffer[v3->field_8 + 640 * v3->field_A], v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689 //----- (00485975) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690 stru315 *__fastcall sr_sub_485975(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12721 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12727 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 v11 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12742 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12744 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12746 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12748 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12749 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 //----- (00485A24) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 stru315 *__fastcall sr_sub_485A24(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 v14 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12821 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12823 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12825 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12829 //----- (00485AFF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 stru315 *__fastcall sr_sub_485AFF(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12844 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12846 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 v7 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12858 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12868 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 v11 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12879 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12880 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12881 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12882 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12883 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12884 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12885 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12886 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12888 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12889 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12891
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12892 //----- (00485BAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12893 stru315 *__fastcall sr_sub_485BAE(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12895 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12896 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12897 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12898 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12899 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12900 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12901 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12902 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12903 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12906 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12907 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12908 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12909 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12910 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12911
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12912 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12913 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12915 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12916 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12917 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12918 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12919 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12920 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12921 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12922 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12923 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12924 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12925 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12926 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12927 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12928 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12929 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12931 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 v10 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 v14 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969 //----- (00485C89) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12970 stru315 *__fastcall sr_sub_485C89(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12972 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12977 int v7; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 int v8; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979 int v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12980 unsigned __int16 *v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 unsigned int *v11; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12982 int v12; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12983 int v13; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12985 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12986 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12990 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 v13 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12993 if ( *((char *)result->pTextureLOD + v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12995 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13000 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 if ( a2->field_8 - v8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13009 v9 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 v10 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 v6 = v13 + (v9 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 v10 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 *result->pColorBuffer = v10[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 v11 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 v12 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023 *v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13033 //----- (00485D3E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13034 stru315 *__fastcall sr_sub_485D3E(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13036 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13041 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13042 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 int v10; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13045 int v11; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 int v12; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13047 unsigned __int16 *v13; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 unsigned int *v14; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 int v15; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13050 int v16; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13051
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13052 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13053 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13055 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13056 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13057 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13058 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13059 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13062 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13063 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13067 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13068 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070 v16 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 if ( *((char *)result->pTextureLOD + v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13073 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13075 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13076 v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13077 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13078 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079 if ( a2->field_8 - v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13085 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13086 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13087 v12 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13089 v13 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13090 v9 = v16 + (v12 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13092 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13094 v13 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13096 *result->pColorBuffer = v13[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13098 v14 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13099 v15 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13101 *v14 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13107 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13108 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13110
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13111 //----- (00485E1F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 void *__fastcall sr_sub_485E1F(stru316 *a1, Span *a2, int a3, stru148 *a4, int a5, unsigned __int8 a6, char a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 stru316 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115 signed int *v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 signed int *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 char v10; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13118 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13119 Span *v12; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13120 double v13; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13121 double v14; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13122 int v15; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13123 signed int v16; // ST14_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13124 char v17; // dl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125 signed int v18; // ST10_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 void *v19; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13127 signed int v20; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13128 char v21; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13129 int v22; // ST10_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13130 signed int v23; // ST14_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13131 char v24; // dl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13132 Span *v26; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13133 char v27; // [sp+16h] [bp-2h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13134 char v28; // [sp+17h] [bp-1h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13135 float v29; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13136 float v30; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 v7 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13139 v26 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13140 v8 = &a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13141 v9 = &a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13142 v10 = a1->field_0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13143 v27 = a1->field_4 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13144 v28 = !v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13145 sr_sub_47BEB1(a3, a4, a5, 0, &a1->field_8, &a1->field_C, (int)&v27, (int)&v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13146 v7->field_24_palette = (unsigned __int16 *)sr_sub_47C28C_get_palette(a4, v28, *v9, *v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13147 v11 = a4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13148 v7->field_20 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13149 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151 if ( a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13153 v12 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13154 v29 = v26->field_10 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 v13 = v29 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13156 v7->field_10 = LODWORD(v13) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13157 v30 = v12->field_14 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13158 v14 = v30 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13159 v15 = v7->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13160 v7->field_14 = LODWORD(v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13161 v7->field_18 = -((v15 - (LODWORD(v14) << 16)) / v12->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13163 v16 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13164 v17 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13165 v18 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13166 v7->field_1C = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13167 v19 = sr_sub_47C28C_get_palette(a4, v17, v18, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13169 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13171 v20 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 v21 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13173 v7->field_10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13174 v7->field_14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13175 v22 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13176 v7->field_18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13177 v7->field_1C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13178 v19 = sr_sub_47C1CA(a4, v21, v22, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13180 v23 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181 v24 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13182 v7->field_24_palette = (unsigned __int16 *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13183 return sr_sub_47C1CA(a4, v24, *v9, v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13186 //----- (00485F53) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13187 void __thiscall sub_485F53(Vec2_int_ *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 ++v->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190 if ( v->y > 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 v->y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 //----- (00485F64) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 void OutdoorCamera::_485F64()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13199 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13200 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13201 signed __int64 v3; // qtt@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13202 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13204 this->uCameraFovInDegrees = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 v1 = stru_5C6E00->uPiMask & 0xD5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 if ( v1 >= (signed int)stru_5C6E00->uIntegerHalfPi )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 v2 = -stru_5C6E00->pTanTable[stru_5C6E00->uIntegerPi - v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13209 v2 = stru_5C6E00->pTanTable[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13210 LODWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13211 HIDWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 15 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13212 v4 = (signed int)(v3 / v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13213 this->int_fov_rad = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 this->field_4C = 360000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 this->int_fov_rad_inv = 65536 / v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216 this->field_50 = 115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13217 unnamed_6BE060[1] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13218 RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13221 //----- (0048600E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 void OutdoorCamera::RotationToInts()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224 camera_rotation_y_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 camera_rotation_y_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13226 camera_rotation_x_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13227 camera_rotation_x_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13231 //----- (0048607B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13232 void stru148::_48607B(stru149 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13234 this->pTexture = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13235 this->ptr_38 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13237
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13238 //----- (00486089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13239 void stru148::_486089_normalize_v_18()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13241 stru148 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13242 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13243 double v3; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13244 float v4; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13245 double v5; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13246 float v6; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13247 double v7; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13248 float v8; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13249 float v9; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13250 double v10; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13251 float v11; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13252 double v12; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13253 float v13; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13254 double v14; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13255 float v15; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13257 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13258 v2 = (double)this->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13259 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13260 v3 = (double)this->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13261 v5 = (double)this->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13262 v7 = sqrt(v5 * v5 + v3 * v3 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13263 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13265 v1->v_18.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13266 v1->v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13267 v1->v_18.z = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13269 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13271 v8 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13272 v9 = v8 * v15 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13273 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13274 v1->v_18.x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13275 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13276 v11 = v8 * v4 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13277 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13278 v1->v_18.y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13279 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13280 v13 = v8 * v6 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13281 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13282 v1->v_18.z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13285
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13286 //----- (0048616B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13287 int stru149::_48616B(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13289 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13290 int v8; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13291 int v9; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13292 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13293 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13294 int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13295 int v13; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13296 int v14; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13297 int v15; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 int v16; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13299 int v17; // ST0C_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13300 int v18; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13301 int v19; // ST0C_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13302 int v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13303 int v21; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13304 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13305 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13306 int v24; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13307 int v25; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13308 int v26; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 int v27; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 int v28; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 int v29; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313 v25 = pOutdoorCamera->camera_rotation_x_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13314 v7 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315 v27 = pOutdoorCamera->camera_rotation_x_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316 v8 = -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 v9 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318 v26 = -pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319 v24 = -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13320 v10 = pOutdoorCamera->camera_rotation_y_int_cosine * -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13321 v11 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13322 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13324 v14 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325 v15 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13326 this->field_0 = ((unsigned __int64)(v11 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13327 + ((unsigned __int64)(-65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13328 * pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13329 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330 this->field_4 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 v13 = ((unsigned __int64)((v26 << 16) * (signed __int64)v25) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13333 - ((unsigned __int64)(v14 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13337 this->field_4 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13338 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 this->field_0 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340 v13 = v26 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342 this->field_8 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13343 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13345 v17 = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13346 this->field_C = ((unsigned __int64)(v17 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347 + ((unsigned __int64)(a4 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13350 v16 = ((unsigned __int64)(a4 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v17 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13352 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13354 this->field_C = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13355 + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13356 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13357 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13358 v16 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13360 this->field_14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13361 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13363 v19 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 this->field_18 = ((unsigned __int64)(v19 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 + ((unsigned __int64)(a7 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13366 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13367 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13368 v18 = ((unsigned __int64)(a7 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13370 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13372 this->field_18 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13373 + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13374 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13375 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13376 v18 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13378 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380 this->field_20 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 v20 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13383 v21 = ((unsigned __int64)(v20 * (signed __int64)this->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13386 v28 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13387 v22 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13388 this->field_24 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13389 v29 = (unsigned __int64)(v28 * (signed __int64)v22) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13390 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13391 this->field_28 = v29 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13392 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13394
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13395 //----- (0048653D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13396 int stru149::_48653D(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13398 stru149 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13400 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13401 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13402 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13403 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13404 int v13; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13405 int v14; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13406 int v15; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13407 int v16; // ST14_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13408 int v17; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13409 int v18; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13410 int v19; // ST10_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13411 int v20; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13412 int v21; // ST10_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414 int v23; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 int v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 int v26; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13418 int v27; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13419 int v28; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13420 int v29; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13421 int v30; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13422 int v31; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13423
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13424 v7 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13425 v8 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13426 v29 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13427 v28 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13428 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13429 v11 = -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13430 v26 = -pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431 v27 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 v12 = -pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13435 v16 = v8 * -pBLVRenderParams->vPartyPos.x + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13436 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13437 v17 = -65536 * pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13438 v7->field_0 = ((unsigned __int64)(v16 * (signed __int64)v28) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13439 + ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13440 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13441 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13442 v15 = ((unsigned __int64)(v17 * (signed __int64)v28) >> 16) - ((unsigned __int64)(v16 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13444 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13446 v7->field_0 = v10 + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450 v15 = v12 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452 v7->field_8 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13453 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13455 v19 = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13456 v7->field_C = ((unsigned __int64)(v19 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13457 + ((unsigned __int64)(a4 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13458 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13459 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13460 v18 = ((unsigned __int64)(a4 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13462 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13464 v7->field_C = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13465 + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 v18 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13470 v7->field_14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 v21 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474 v7->field_18 = ((unsigned __int64)(v21 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13475 + ((unsigned __int64)(a7 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13476 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13477 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13478 v20 = ((unsigned __int64)(a7 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v21 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13480 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13482 v7->field_18 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13483 + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13484 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13485 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13486 v20 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488 v7->field_18 = -v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 v7->field_1C = -v7->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 v7->field_20 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 v22 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 v7->field_20 = -v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493 v23 = ((unsigned __int64)(v22 * (signed __int64)v7->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13494 + ((unsigned __int64)(v7->field_10 * (signed __int64)v7->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 + ((unsigned __int64)(v7->field_14 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13496 v30 = v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497 v24 = v7->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13498 v7->field_24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499 v31 = (unsigned __int64)(v30 * (signed __int64)v24) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13500 result = (unsigned __int64)(v7->field_1C * (signed __int64)v7->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 v7->field_28 = v31 + result + ((unsigned __int64)(v7->field_20 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13504
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13505 //----- (0048694B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13506 int stru149::_48694B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13508 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13509 int v2; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13510 int v3; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13511 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13512 int v5; // ST0C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13513 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13514
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13515 v1 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13516 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13517 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13518 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13519 v2 = (unsigned __int64)(v1 * (signed __int64)this->field_0) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13520 v3 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13521 v4 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13522 this->field_24 = v2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13523 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13524 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13525 v5 = (unsigned __int64)(v3 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13526 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13527 this->field_28 = v5 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13528 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 //----- (00486A28) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533 void OutdoorCamera::AllocSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 if ( !this || !pSpans )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13537 ReleaseSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13538 pSpans = (Span *)pAllocator->AllocNamedChunk(pSpans, 0x493E0u, "SPANS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539 pEdges = (Edge *)pAllocator->AllocNamedChunk(pEdges, 0x4C2C0u, "EDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 pSurfs = (Surf *)pAllocator->AllocNamedChunk(pSurfs, 0x11940u, "SURFS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 pNewEdges = (Edge *)pAllocator->AllocNamedChunk(pNewEdges, 0x6180u, "NEWEDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 memset(pSpans, 0, 0x493E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13543 memset(pEdges, 0, 0x4C2C0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13544 memset(pSurfs, 0, 0x11940u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13545 memset(pNewEdges, 0, 0x6180u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13548
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13549 //----- (00486AFC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 void OutdoorCamera::ReleaseSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13552 pAllocator->FreeChunk(pSpans);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13553 pAllocator->FreeChunk(pEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13554 pAllocator->FreeChunk(pSurfs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 pAllocator->FreeChunk(pNewEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13556 pSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557 pEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 pSurfs = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13559 pNewEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 //----- (00486B4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563 char __fastcall sr_sub_486B4E_push_outdoor_edges(RenderVertexSoft *a1, int *a2, int *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13565 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13566 RenderVertexSoft *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567 char v6; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13569 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570 int *v9; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571 int v10; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 int v11; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573 double v12; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13574 int *v13; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 double v14; // st6@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13576 double v15; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13577 int v16; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13578 double v17; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13579 double v18; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580 int v19; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13581 double v20; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13582 double v21; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13583 Edge *i; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584 double v23; // st7@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 Edge *v24; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13586 std::string v26; // [sp-18h] [bp-98h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13587 const char *v27; // [sp-8h] [bp-88h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588 int v28; // [sp-4h] [bp-84h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 double v29; // [sp+Ch] [bp-74h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590 double v30; // [sp+14h] [bp-6Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13591 double v31; // [sp+1Ch] [bp-64h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 double v32; // [sp+24h] [bp-5Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13593 double v33; // [sp+2Ch] [bp-54h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 unsigned int v34; // [sp+34h] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13595 unsigned __int64 v35; // [sp+38h] [bp-48h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13596 int v36; // [sp+40h] [bp-40h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13597 int v37; // [sp+44h] [bp-3Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13598 float v38; // [sp+48h] [bp-38h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599 int v39; // [sp+4Ch] [bp-34h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600 int v40; // [sp+50h] [bp-30h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601 int v41; // [sp+54h] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602 RenderVertexSoft *v42; // [sp+58h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13603 int v43; // [sp+5Ch] [bp-24h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604 int v44; // [sp+60h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13605 int v45; // [sp+64h] [bp-1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13606 unsigned int v46; // [sp+68h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 int *v47; // [sp+6Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13608 int v48; // [sp+70h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 float *v49; // [sp+74h] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 float v50; // [sp+78h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611 float v51; // [sp+7Ch] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13612
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13613 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614 v5 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615 v47 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13616 v6 = (HIBYTE(a4->flags) & 0x40) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 v42 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13618 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13620 MessageBoxW(nullptr, L"The Texture Frame Table is not a supported feature.", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Odspan.cpp:162", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13622 LOBYTE(v7) = v4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623 v8 = v4->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624 v4->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625 BYTE3(a4) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13626 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 if ( (signed int)pOutdoorCamera->uNumSurfs < 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13631 v7 = pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 if ( (signed int)pOutdoorCamera->uNumEdges < 5979 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13634 v4->uEdgeList1Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13635 v4->uEdgeList2Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13636 v45 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 v34 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638 v28 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13639 v27 = (const char *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 v44 = 10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641 pGame->pLightmapBuilder->_45CB89(v5, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13642 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 v9 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646 v49 = &v5->flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 v46 = (char *)v47 - (char *)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13648 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13650 v10 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13651 ++pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652 if ( v48 >= v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13654 v11 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13655 LODWORD(v50) = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13656 if ( SLODWORD(v50) > v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657 v45 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658 if ( v11 < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13659 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13660 v12 = (double)SLODWORD(v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13661 v13 = &a3[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13662 v51 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13663 v14 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13664 v50 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13665 *(float *)&v40 = v14 - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 v33 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13667 v43 = LODWORD(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13668 if ( LODWORD(v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13670 if ( SLODWORD(v33) >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13672 v19 = (int)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13673 ptr_80C978_Edges->field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674 LODWORD(v38) = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675 v40 = *(unsigned int *)LODWORD(v38) - *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13677 v20 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13678 v40 = *v13 - *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13679 v21 = v20 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13680 ptr_80C978_Edges->field_4 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13681 ptr_80C978_Edges->field_0 = (v51 - (double)*v9) * v21 + (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13682 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13684 ptr_80C978_Edges->field_1C = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13685 ptr_80C978_Edges->field_20 = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 ptr_80C978_Edges->field_24 = (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 ptr_80C978_Edges->field_28 = (double)(signed int)*(unsigned int *)LODWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13688 ptr_80C978_Edges->field_2C = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689 ptr_80C978_Edges->field_30 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 v4->pEdgeList1[v4->uEdgeList1Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13695 v32 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13696 v39 = LODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13697 v51 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13698 v15 = (double)SLODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13699 ptr_80C978_Edges->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 v16 = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13701 v50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13702 v40 = *(int *)((char *)v9 + v46) - *(int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704 v17 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13705 v40 = *v9 - *v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 v18 = v17 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 ptr_80C978_Edges->field_4 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 ptr_80C978_Edges->field_0 = (v51 - (double)*v13) * v18 + (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 ptr_80C978_Edges->field_1C = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 ptr_80C978_Edges->field_20 = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 ptr_80C978_Edges->field_24 = (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714 ptr_80C978_Edges->field_28 = (double)*(int *)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715 ptr_80C978_Edges->field_2C = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716 ptr_80C978_Edges->field_30 = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 v4->pEdgeList2[v4->uEdgeList2Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720 v31 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 v37 = LODWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722 for ( i = &pNewEdges[LODWORD(v31)]; i->pNext->field_0 < (double)ptr_80C978_Edges->field_0; i = i->pNext )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724 if ( i->field_0 != ptr_80C978_Edges->field_0 || i->field_8 || ptr_80C978_Edges->field_8 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726 ptr_80C978_Edges->pNext = i->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 i->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 ptr_80C978_Edges->pNext = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732 i->pPrev->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13734 v23 = v50 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13735 *(float *)&v40 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13736 v38 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13737 v30 = v38 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738 v36 = LODWORD(v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13739 ptr_80C978_Edges->ptr_18 = ptr_80CA10[LODWORD(v30)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740 v29 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 v35 = __PAIR__(v40, LODWORD(v29));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742 v24 = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 ptr_80CA10[LODWORD(v29)] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13744 v24->pSurf = ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 if ( ptr_80C978_Edges < &pEdges[5999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746 ++ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 v49 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13752 while ( v48 - 1 < v41 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13754 LOBYTE(v7) = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13755 if ( pOutdoorCamera->uNumEdges != v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757 v4->ptr_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 ptr_80C97C_Surfs->field_22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13759 ptr_80C97C_Surfs->pParent = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13760 ptr_80C97C_Surfs->field_4 = v4->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13761 ptr_80C97C_Surfs->field_8 = v4->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13762 ptr_80C97C_Surfs->field_0 = v4->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13763 ptr_80C97C_Surfs->field_C = v4->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13764 ptr_80C97C_Surfs->field_10 = v4->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13765 LOBYTE(v7) = (char)pSurfs + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13766 if ( ptr_80C97C_Surfs < &pSurfs[1999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13768 ++ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13769 ++pOutdoorCamera->uNumSurfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13771 if ( BYTE3(a4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13772 v4->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13777 return v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13779
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13780
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13781
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13782 //----- (0043F953) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13783 int __cdecl PrepareWallsRenderList_BLV()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13785 pStru170->uNumFaceIDs = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13786 if ( pBLVRenderParams->uRadius )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13788 pStru170->field_FA8[0].uSectorID = LOWORD(pBLVRenderParams->uRadius);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13789 pStru170->field_FA8[0].uViewportW = LOWORD(pBLVRenderParams->uViewportW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13790 pStru170->field_FA8[0].uViewportZ = LOWORD(pBLVRenderParams->uViewportZ);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13791 pStru170->field_FA8[0].uViewportY = LOWORD(pBLVRenderParams->uViewportY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792 pStru170->field_FA8[0].uViewportX = LOWORD(pBLVRenderParams->uViewportX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13793 pStru170->field_FA8[0].field_C._43F9E1(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13794 SLOWORD(pBLVRenderParams->uViewportX),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13795 SLOWORD(pBLVRenderParams->uViewportY),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13796 SLOWORD(pBLVRenderParams->uViewportZ),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13797 SLOWORD(pBLVRenderParams->uViewportW));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13798 pStru170->field_FA8[0].uFaceID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13799 pStru170->field_FA8[0].std__vector_0007A8 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13800 pStru170->std__vector_000FA8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13801 sub_440639(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13803 return pStru170->RenderWalls();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13805
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13806 //----- (0043F9E1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13807 __int16 *stru170_stru2::_43F9E1(__int16 x, int y, __int16 z, int w)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13809 signed int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 __int16 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13811
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812 auto a2 = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13813 auto a3 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13814 auto a4 = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13815 auto a5 = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13817 this->_viewport_space_y = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13818 this->field_4 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13819 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13820 result = this->array_3D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13821 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13823 if ( v5 < a3 || v5 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13825 *result = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13826 *(result - 480) = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13828 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13830 *(result - 480) = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13831 *result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13836 while ( v5 < 480 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13837 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13839
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13840 //----- (0043FA33) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13841 void __fastcall PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13843 LevelDecoration *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 DecorationDesc *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13845 __int16 v4; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13846 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13847 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13848 int v7; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 unsigned int v8; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 int v9; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13851 int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 SpriteFrame *v11; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13853 SpriteFrame *v12; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13854 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13855 int v14; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 RenderBillboard *v15; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13857 char v16; // zf@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13858 IndoorCameraD3D **v17; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13859 double v18; // st7@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13860 float v19; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13861 signed __int64 v20; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862 signed __int64 v21; // qtt@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13863 int v22; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13864 int v23; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 Particle_ local_0; // [sp+Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 double v25; // [sp+74h] [bp-38h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867 unsigned int v26; // [sp+7Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 int a2; // [sp+80h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 int a3; // [sp+84h] [bp-28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13870 int a1; // [sp+88h] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13871 int v30; // [sp+8Ch] [bp-20h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13872 float v31; // [sp+90h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13873 int a5; // [sp+94h] [bp-18h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13874 int z; // [sp+98h] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13875 int a6; // [sp+9Ch] [bp-10h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13876 int y; // [sp+A0h] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13877 int x; // [sp+A4h] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13878 int v37; // [sp+A8h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13879
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13880 v26 = uDecorationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13881 LODWORD(v31) = uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13882 v2 = &pLevelDecorations[uDecorationID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13883 if ( !(v2->field_2 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13885 v3 = &pDecorationList->pDecorations[v2->uDecorationDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13886 v4 = v3->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13887 if ( (char)v4 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13889 if ( !(v4 & DECORATION_DONT_DRAW) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13891 v6 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13892 v7 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13893 a2 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13894 a1 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13895 a3 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13896 v8 = v2->field_10_y_rot
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13897 + ((signed int)stru_5C6E00->uIntegerPi >> 3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13898 - stru_5C6E00->Atan2(v6 - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13899 v37 = pBLVRenderParams->field_0_timer_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13900 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13901 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13902 v37 = pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13903 v10 = abs(v2->vPosition.x + v2->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13904 v11 = pSpriteFrameTable->GetFrame(v3->uSpriteID, v37 + v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13905 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13906 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13907 v13 = v11->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13908 if ( v13 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13909 v30 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13910 if ( v13 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13911 v30 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13912 if ( v13 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13913 LOBYTE(v30) = v30 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13914 if ( (256 << v9) & v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13915 v30 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13916 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(a1, a2, a3, &x, &y, &z, 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13918 v14 = abs(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13919 if ( v14 >= abs(y) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13921 pGame->pIndoorCameraD3D->Project(x, y, z, &a5, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13922 v15 = &pBillboardRenderList[uNumBillboardsToDraw];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13923 if ( (signed int)uNumBillboardsToDraw < 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13925 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13926 ++uNumDecorationsDrawnThisFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13927 v16 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13928 v15->uHwSpriteID = v12->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13929 v15->uPalette = v12->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13930 v15->uIndoorSectorID = LOWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13931 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13933 LODWORD(v21) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13934 HIDWORD(v21) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13935 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13936 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13937 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13938 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v21 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13939 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13940 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13941 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13943 v17 = &pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13944 v15->flt_8 = pGame->pIndoorCameraD3D->flt_D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13945 v18 = (*v17)->flt_D4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13946 v19 = v15->flt_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13947 v15->flt_C = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13948 v31 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13949 v25 = v19 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13950 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13951 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13952 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13953 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13954 v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13955 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13956 v31 = v15->flt_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13957 v25 = v31 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13958 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13959 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13960 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13961 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13963 HIWORD(v22) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13964 v15->field_4 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13965 v15->field_1E = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13966 v15->field_20 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13967 v15->field_22 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13968 v15->field_24 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13969 v15->field_26 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 v15->field_28 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13971 v23 = 8 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 LOBYTE(v23) = 8 * v26 | 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13973 LOWORD(v22) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13974 v15->field_2C_prolly_tint = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13975 v15->sZValue = v22 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 v15->pSpriteFrame = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13982 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13984 memset(&local_0, 0, 0x68u); // fire, like at the Pit's tavern
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13985 v5 = (double)v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13986 local_0.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13987 local_0.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13988 local_0.x = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13989 local_0.y = (double)v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13990 local_0.z = (double)v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13991 local_0.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13992 local_0.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13993 local_0.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13994 local_0.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995 local_0.field_20 = (rand() & 0x80) + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13996 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13997 pGame->pParticleEngine->AddParticle(&local_0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14001
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14002
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14003 //----- (0044028F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14004 void __cdecl PrepareItemsRenderList_BLV()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14006 char *v0; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14007 ObjectDesc *v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14008 __int16 v2; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14009 RenderBillboard *v3; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14010 SpriteFrame *v4; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14011 SpriteFrame *v5; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14012 unsigned int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14013 int v7; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14014 int v8; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14015 int v9; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 unsigned __int16 v10; // ax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14017 int *v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14018 char v12; // zf@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 IndoorCameraD3D **v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 double v14; // st7@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14021 float v15; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14022 double v16; // ST30_8@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14023 signed __int64 v17; // qtt@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14024 int v18; // ST5C_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14025 signed __int64 v19; // qtt@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026 int v20; // ST5C_4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14027 int v21; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14028 __int16 v22; // ax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029 int v23; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14030 SpriteFrame *v24; // [sp+1Ch] [bp-40h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14031 ObjectDesc *v25; // [sp+20h] [bp-3Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 __int16 a5; // [sp+28h] [bp-34h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033 int a6; // [sp+2Ch] [bp-30h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034 int a2; // [sp+30h] [bp-2Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14035 int a1; // [sp+34h] [bp-28h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14036 int v30; // [sp+38h] [bp-24h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14037 int v31; // [sp+38h] [bp-24h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14038 signed int v32; // [sp+3Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039 int a3; // [sp+40h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14040 signed __int16 v34; // [sp+44h] [bp-18h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14041 int v35; // [sp+48h] [bp-14h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14042 int v36; // [sp+4Ch] [bp-10h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14043 signed int z; // [sp+50h] [bp-Ch]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14044 signed int y; // [sp+54h] [bp-8h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 signed int x; // [sp+58h] [bp-4h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14046
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14048 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14050 v0 = (char *)&pLayingItems[0].uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14051 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14053 if ( *((short *)v0 - 13) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14055 v1 = &pObjectList->pObjects[*((short *)v0 - 13)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14056 v25 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14057 if ( !(v1->uFlags & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14059 if ( ((v2 = *((short *)v0 - 14), v2 < 1000) || v2 >= 10000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14060 && (v2 < 500 || v2 >= 600)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14061 && (v2 < 811 || v2 >= 815)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14062 || pGame->pStru6Instance->_4A81CA((LayingItem *)(v0 - 28)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14064 a5 = *(short *)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14065 a1 = *((int *)v0 - 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14066 a2 = *((int *)v0 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14067 a3 = *((int *)v0 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14068 v3 = &pBillboardRenderList[uNumBillboardsToDraw];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14069 v4 = pSpriteFrameTable->GetFrame(v1->uSpriteID, *((short *)v0 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14070 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14071 v24 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14072 v30 = v4->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14073 a6 = v4->uGlowRadius * *((short *)v0 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14074 v6 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14075 *((int *)v0 - 6) - pBLVRenderParams->vPartyPos.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14076 *((int *)v0 - 5) - pBLVRenderParams->vPartyPos.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14077 LOWORD(v7) = *((short *)v0 - 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14079 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 v10 = v5->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14081 v3->uHwSpriteID = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14082 if ( v30 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14084 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14085 a3 -= (signed int)((unsigned __int64)(v5->scale
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14086 * (signed __int64)pSprites_LOD->pSpriteHeaders[(signed __int16)v10].uHeight) >> 16) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14089 if ( v8 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14090 v34 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091 if ( v8 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 v34 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 if ( v8 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 LOBYTE(v34) = v34 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095 v11 = (int *)(256 << v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096 if ( (256 << v9) & v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14097 v34 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14098 if ( a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14100 LOBYTE(v11) = byte_4E94D3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14101 pMobileLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14103 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14104 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 a6,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 v25->uParticleTrailColorR,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 v25->uParticleTrailColorG,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14109 v25->uParticleTrailColorB,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14110 v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14113 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14115 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14116 &x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14117 &y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14118 &z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14119 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14121 pGame->pIndoorCameraD3D->Project(x, y, z, &v36, &v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14122 if ( (signed int)uNumBillboardsToDraw >= 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14123 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14124 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14125 ++uNumSpritesDrawnThisFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14126 *(v0 - 2) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14127 v12 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14128 v3->uPalette = v24->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14129 v3->uIndoorSectorID = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14130 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14132 LODWORD(v19) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14133 HIDWORD(v19) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14134 v20 = v19 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14135 v3->field_0 = (unsigned __int64)(v24->scale * v19 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14136 v31 = (unsigned __int64)(v24->scale * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14138 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14140 v13 = &pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 v3->flt_8 = pGame->pIndoorCameraD3D->flt_D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14142 v14 = (*v13)->flt_D4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14143 v15 = v3->flt_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14144 v3->flt_C = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14145 v16 = v15 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14146 LODWORD(v17) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14147 HIDWORD(v17) = SLOWORD(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14148 v18 = v17 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14149 v3->field_0 = (unsigned __int64)(v24->scale * v17 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14150 v31 = (unsigned __int64)(v24->scale * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 HIWORD(v21) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14153 v3->field_4 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14154 v3->field_1E = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14155 v3->field_20 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 v3->field_22 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 v3->field_24 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14158 v3->field_26 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14159 v22 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14160 v3->field_2C_prolly_tint = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14161 v3->field_28 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 LOWORD(v21) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14163 v23 = 8 * v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14164 LOBYTE(v23) = 8 * v32 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14165 v3->pSpriteFrame = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 v12 = (*(v0 - 2) & 0x20) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 v3->sZValue = v21 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14170 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14171 v3->sZValue = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14177 ++v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14178 v0 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14180 while ( v32 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186 //----- (00440639) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 void __fastcall sub_440639(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14189 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14190 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 BLVSector *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14194 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14195 v3 = &pIndoor->pSectors[pStru170->field_FA8[a1].uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14201 pStru170->_4B0EA8(v1, v3->pFaceIDs[v2++]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 pStru170->_4AFB86(v1, v3->pFaceIDs[v2++]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14211 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 if ( v3->field_0 & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 sub_4406BC(v1, v3->uFirstBSPNode);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14218 //----- (004406BC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 void __fastcall sub_4406BC(int a1, unsigned int uFirstNode)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221 BLVSector *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14222 BSPNode *v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14223 BLVFace *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14224 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 __int16 v6; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226 int v7; // ebp@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 int v8; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14228 __int16 v9; // di@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 int v10; // [sp+10h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14230 bool v11; // [sp+14h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14231 stru170_stru0 *v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233 v10 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 v12 = &pStru170->field_FA8[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237 v2 = &pIndoor->pSectors[v12->uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238 v3 = &pIndoor->pNodes[uFirstNode];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239 v4 = &pIndoor->pFaces[v2->pFaceIDs[v3->uCoplanarOffset]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14240 v5 = v4->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14241 + pBLVRenderParams->vPartyPos.x * v4->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242 + pBLVRenderParams->vPartyPos.y * v4->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 + pBLVRenderParams->vPartyPos.z * v4->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 if ( v4->uAttributes & 1 && v4->uSectorID != v12->uSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245 v5 = -v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14246 v11 = v5 > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14247 if ( v5 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14248 v6 = v3->uFront;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14249 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 v6 = v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 sub_4406BC(v10, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 v7 = v3->uCoplanarOffset;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 v8 = v7 + v3->uCoplanarSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257 while ( v7 < v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258 pStru170->_4B0EA8(v10, v2->pFaceIDs[v7++]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 while ( v7 < v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263 pStru170->_4AFB86(v10, v2->pFaceIDs[v7++]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265 v9 = v11 ? v3->uFront : v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266 if ( v9 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 uFirstNode = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 //----- (00440DF5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273 int stru167_wrap::Push(__int16 a2, __int16 a3, __int16 a4, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 stru167_wrap *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 v6->pElements[v6->uNumElements].field_6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280 this->pElements[this->uNumElements].field_8 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 this->pElements[this->uNumElements].field_A = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 v6->pElements[v6->uNumElements].field_C = rand() % 64 + 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 v6->pElements[v6->uNumElements].field_E = v6->pElements[v6->uNumElements].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 result = 3 * v6->uNumElements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285 v6->pElements[v6->uNumElements++].bgr16 = bgr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 if ( v6->uNumElements >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287 v6->uNumElements = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291 //----- (00440E91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 void stru167_wrap::_440E91(__int16 x, int y, int z, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 stru167_wrap *v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 int i; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 int v8; // ST08_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 int v9; // ST04_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 int v10; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301 for ( i = 0; i < rand() % 6 + 5; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 v8 = z + rand() % 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 v9 = rand() % 33 + y - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14306 Push(v10 % 33 + x - 16, v9, v8, a5, bgr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310 //----- (00440F07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311 void stru167_wrap::_440F07()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14316 v1 = (char *)&this->pElements[0].field_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 v2 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320 if ( *((short *)v1 + 3) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 *((short *)v1 + 2) += rand() % 5 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323 *(short *)v1 += rand() % 5 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 *((short *)v1 + 1) += rand() % 5 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325 *((short *)v1 + 3) -= LOWORD(pEventTimer->uTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 v1 += 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 --v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 while ( v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 //----- (0044100D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 bool __cdecl sub_44100D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 return uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions > 12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 && (uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions <= 14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions > 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 && (uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions <= 18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 23));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 // 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
14345
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 //----- (00441498) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 void __cdecl GameUI_DrawTorchlightAndWizardEye()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349 unsigned int v0; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 IconFrame *v1; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 unsigned int v2; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 IconFrame *v3; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 if ( !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
14355 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 || 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
14358 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 v0 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370 v1 = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 pUIAnum_Torchlight->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 pUIAnum_Torchlight->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374 &pIcons_LOD->pTextures[v1->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 if ( SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 && (SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[19].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 v2 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380 v3 = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382 pUIAnim_WizardEye->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 pUIAnim_WizardEye->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384 &pIcons_LOD->pTextures[v3->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388 // 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
14389
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14390 //----- (0044158F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14391 void __cdecl GameUI_DrawCharacterSelectionFrame()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14393 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing__negindex[uActiveCharacter] - 9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 0x17Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397 &pIcons_LOD->pTextures[dword_50C98C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 // 4ED746: using guessed type __int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing__negindex[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 // 50C98C: using guessed type int dword_50C98C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 //----- (004415C5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 void __cdecl Load_isn_spells_21_27()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14406 char pContainer[120]; // [sp+8h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14407
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14409 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14411 sprintf(pContainer, "isn-%02d", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 pTextureIDs_isns[v0++] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 while ( v0 < 14 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415 uIconIdx_Spell21 = pIconsFrameTable->FindIcon("spell21");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416 uIconIdx_Spell27 = pIconsFrameTable->FindIcon("spell27");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 //----- (0044162D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420 void __cdecl GameUI_DrawPartySpells()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 unsigned int v0; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14423 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14424 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425 int v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 __int16 *v4; // ebx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 Player *v5; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428 unsigned int v6; // [sp-4h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 Texture *v7; // [sp-4h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430 unsigned int v8; // [sp-4h] [bp-1Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431 Texture *v9; // [sp-4h] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432 Player **v10; // [sp+10h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 v0 = (signed __int64)((double)GetTickCount() * 0.050000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 v2 = (unsigned __int8)byte_4E5DD8[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14439 if ( SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 && (SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14442 v3 = pTextureIDs_isns[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 pRenderer->_4A65CC(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14444 pPartySpellbuffsUI_XYs[v1][0],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 pPartySpellbuffsUI_XYs[v1][1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448 v0 + 20 * pPartySpellbuffsUI_smthns[v1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14450 63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454 while ( v1 < 14 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455 if ( !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
14456 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14461 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell21, v6)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466 pRenderer->DrawTextureIndexed(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14467 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 pRenderer->DrawTextureTransparent(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470 if ( SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471 && (SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[18].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 if ( pParty->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14474 v8 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell27, v8)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14478 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14479 pRenderer->DrawTextureIndexed(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 pRenderer->DrawTextureTransparent(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14484 v10 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14485 v4 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14486 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 v5 = *v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489 if ( (signed __int64)(*v10)->pPlayerBuffs[6].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 0x1ABu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14493 (Texture *)(dword_507964 != -1 ? (int)&pIcons_LOD->pTextures[dword_507964] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14494 if ( (signed __int64)v5->pPlayerBuffs[1].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14495 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14497 0x189u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14498 (Texture *)(dword_50796C != -1 ? (int)&pIcons_LOD->pTextures[dword_50796C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14499 if ( (signed __int64)v5->pPlayerBuffs[11].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14500 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14501 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14502 0x19Au,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14503 (Texture *)(dword_507968 != -1 ? (int)&pIcons_LOD->pTextures[dword_507968] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14504 if ( (signed __int64)v5->pPlayerBuffs[10].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14505 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14506 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14507 0x1BCu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14508 (Texture *)(dword_507960 != -1 ? (int)&pIcons_LOD->pTextures[dword_507960] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14509 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14510 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14512 while ( (signed int)v4 < (signed int)pBaseHealthByClass );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14514
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14515
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14516 //----- (00441A4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14517 __int16 __fastcall sub_441A4E(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14519 __int16 result; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14520 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14521 char *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14522 int v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14523 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14524 SpriteFrame *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14525 SpriteFrame *v7; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14526 int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14527 unsigned __int16 v9; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14528 RenderBillboardTransform_local0 v10; // [sp+Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14529 int v11; // [sp+5Ch] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14530 int v12; // [sp+60h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 int v13; // [sp+64h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14533 v10.uParentBillboardID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14534 v10.pTarget = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14535 v10.pTargetZ = pRenderer->pActiveZBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536 v10.uTargetPitch = pRenderer->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14537 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14539 v10.uViewportX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540 v10.uViewportY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 v10.uViewportZ = 639;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 v10.uViewportW = 479;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544 v3 = (char *)&pOtherOverlayList->pOverlays[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547 if ( *((short *)v3 - 3) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 result = *((short *)v3 - 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 if ( result >= 300 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 v4 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 v5 = result == v2 + 320 | result == v2 + 330 | result == v2 + 340 | result == v2 + 350;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 result = v2 + 310;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 if ( v4 == v2 + 310 | v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 if ( !*(short *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 v6 = pSpriteFrameTable->GetFrame(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 pOverlayList->pOverlays[*((short *)v3 - 5)].uSpriteFramesetID,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 *((short *)v3 - 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 v11 = *((int *)v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564 v13 = v6->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 v13 = (unsigned __int64)(v11 * (signed __int64)v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 v10.field_8 = *((short *)v3 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14567 v10.field_C = *((short *)v3 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 v10.field_10 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 v10.field_14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 v10.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v6->uPaletteIndex, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 v8 = *((short *)v3 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 v10.field_28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573 v10.uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 v9 = pOverlayList->pOverlays[v8].uOverlayType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 if ( !v9 || v9 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576 v10.field_C += pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]].uHeight >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 result = pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]]._4AD2D1(&v10, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 if ( v12 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14585 v3 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14587 while ( (signed int)v3 < (signed int)&pOverlayList->pOverlays );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14588 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14590
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14591
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 //----- (00441D38) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 void __fastcall GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int flags)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 BLVFace *v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598 unsigned int *v8; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 unsigned int v9; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 unsigned int v10; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 __int16 v11; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 int v12; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 unsigned int v13; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604 unsigned int v14; // ebx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 unsigned int *v16; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607 __int16 v17; // di@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 double v18; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14609 float v19; // ST38_4@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14610 double v20; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611 double v21; // st6@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 double v22; // st5@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 float v23; // ST3C_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 double v24; // ST20_8@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 double v25; // ST20_8@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 unsigned __int16 *v26; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617 signed int v27; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 unsigned __int16 *v28; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619 signed int v29; // edi@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 int v30; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 unsigned __int16 *v31; // ebx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 signed int v32; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14623 signed int v33; // ebx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 unsigned int v34; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 signed int v35; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14626 unsigned __int16 v36; // di@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14627 int v37; // edi@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 int v38; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 __int16 v39; // ax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 int v40; // edi@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14631 int v41; // ebx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632 unsigned int v42; // eax@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14633 unsigned int v43; // ebx@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14634 unsigned int v44; // ST30_4@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14635 char *v45; // ebx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14636 int v46; // edi@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14637 int v47; // eax@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14638 unsigned int v48; // ebx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14639 unsigned int v49; // ST64_4@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14640 double v50; // ST20_8@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14641 unsigned int v51; // [sp-10h] [bp-64h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14642 unsigned int v52; // [sp-10h] [bp-64h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14643 unsigned int v53; // [sp-Ch] [bp-60h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14644 unsigned int v54; // [sp-Ch] [bp-60h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14645 unsigned int v55; // [sp-8h] [bp-5Ch]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14646 unsigned int v56; // [sp-8h] [bp-5Ch]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14647 signed int v57; // [sp-4h] [bp-58h]@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14648 unsigned __int16 v58; // [sp-4h] [bp-58h]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14649 unsigned __int16 v59; // [sp-4h] [bp-58h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14650 unsigned __int16 v60; // [sp+10h] [bp-44h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14651 unsigned int v61; // [sp+10h] [bp-44h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652 unsigned __int16 *v62; // [sp+14h] [bp-40h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 unsigned int v63; // [sp+14h] [bp-40h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 int v64; // [sp+18h] [bp-3Ch]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 unsigned int v65; // [sp+18h] [bp-3Ch]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 unsigned int lPitch; // [sp+20h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 unsigned int lPitcha; // [sp+20h] [bp-34h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14658 char *lPitchb; // [sp+20h] [bp-34h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 unsigned int v69; // [sp+24h] [bp-30h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 signed int v70; // [sp+24h] [bp-30h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 signed int uBluea; // [sp+28h] [bp-2Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 int v73; // [sp+2Ch] [bp-28h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 unsigned __int8 *v74; // [sp+30h] [bp-24h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 signed int v75; // [sp+34h] [bp-20h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666 int v76; // [sp+34h] [bp-20h]@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 int v77; // [sp+34h] [bp-20h]@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 signed int v78; // [sp+38h] [bp-1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 int v79; // [sp+38h] [bp-1Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 bool v80; // [sp+3Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 unsigned int a2; // [sp+40h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 int a2a; // [sp+40h] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 signed int a2b; // [sp+40h] [bp-14h]@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 char *a2c; // [sp+40h] [bp-14h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 unsigned int a3; // [sp+44h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 int a3a; // [sp+44h] [bp-10h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 signed int uHeight; // [sp+48h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 signed int uWidth; // [sp+4Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14679 signed int uZa; // [sp+5Ch] [bp+8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 signed int uZb; // [sp+5Ch] [bp+8h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 signed int uZc; // [sp+5Ch] [bp+8h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682 signed int uZd; // [sp+5Ch] [bp+8h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 signed int uZe; // [sp+5Ch] [bp+8h]@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 signed int uZf; // [sp+5Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 signed int uZg; // [sp+5Ch] [bp+8h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686 unsigned int uWa; // [sp+60h] [bp+Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 float uWb; // [sp+60h] [bp+Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 float uWe; // [sp+60h] [bp+Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 unsigned __int16 *uWc; // [sp+60h] [bp+Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690 unsigned int uWd; // [sp+60h] [bp+Ch]@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 float uZooma; // [sp+64h] [bp+10h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 signed int flagsa; // [sp+68h] [bp+14h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 unsigned int flagsb; // [sp+68h] [bp+14h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694 char *flagsc; // [sp+68h] [bp+14h]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14695 unsigned int flagsd; // [sp+68h] [bp+14h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14696
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14697 a3 = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 a2 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 uWidth = (signed int)(uX + uZ) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700 uHeight = (signed int)(uY + uW) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 lPitch = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 v80 = (signed __int64)pParty->pPartyBuffs[19].uExpireTime > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 v75 = pParty->pPartyBuffs[19].uSkill;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 if ( CheckHiredNPCSpeciality(0x26u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 v80 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711 pRenderer->Clip_v2(a2, a3, uZ - 1, uW - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 v6 = uW - a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 uZc = uZ - a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 v74 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 v62 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719 v73 = (1 << (v17 + 16)) / (signed int)uZoom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14720 v18 = (double)(1 << (16 - v17));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721 v19 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 v20 = (double)(pParty->vPosition.x + 32768) / v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723 v21 = (double)(32768 - pParty->vPosition.z) / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 uWb = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 if ( uZoom == 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727 v20 = v20 - (double)(uZc / 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728 v22 = (double)(v6 / 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 if ( uZoom == 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 v20 = v20 - (double)(uZc / 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 v22 = (double)(v6 / 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14736 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14737 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 if ( uZoom != 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14741 v20 = v20 - (double)(uZc / 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14742 v22 = (double)(v6 / 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 uWb = v21 - v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14746 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14747 v23 = v20 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14748 v24 = v23 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 v70 = LODWORD(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750 uWe = uWb * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14751 v25 = uWe + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14752 v78 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14753 uBluea = LODWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754 v26 = (unsigned __int16 *)_56EFD8_minimap;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 v27 = SLODWORD(v25) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 uWc = (unsigned __int16 *)_56EFD8_minimap;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757 v28 = &pRenderer->pTargetSurface[a2 + a3 * lPitch];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14758 if ( flags )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14760 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14762 v64 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 if ( v6 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 a3a = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766 v29 = v70 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14769 a2b = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14770 if ( uZc > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 v30 = (int)&v74[v27 * v64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 flagsa = uZc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14774 a2b = uZc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14775 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14777 v31 = uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778 ++uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14779 *v31 = v62[*(char *)(v30 + v29)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14780 v78 += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14781 v29 = v78 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782 --flagsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14784 while ( flagsa );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14786 v78 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14787 v29 = v70 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 v28 += 137 - a2b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14789 uBluea += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14790 v27 = uBluea >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14791 --a3a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14793 while ( a3a );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797 uZd = 117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14800 v32 = 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14801 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 *v28 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808 while ( v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14809 v28 += lPitch - 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14810 --uZd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 while ( uZd );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813 uNumBlueFacesInBLVMinimap = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14814 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14816 pRenderer->FillRect2(v6, a2, a3, uZ - a2, v6, 0xFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817 uNumBlueFacesInBLVMinimap = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 uZa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14819 if ( (signed int)*pIndoor->pMapVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14821 a2a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822 v7 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14825 v8 = &pIndoor->pMapVertices[a2a + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14826 v9 = v7[LOWORD(pIndoor->pMapVertices[a2a + 2])].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827 if ( !(BYTE1(v9) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14829 v10 = v7[HIWORD(pIndoor->pMapVertices[a2a + 2])].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14830 if ( !(BYTE1(v10) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832 v11 = HIWORD(pIndoor->pMapVertices[a2a + 3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 if ( v11 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 if ( (v9 & 0x80u) != 0 || (v10 & 0x80u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 ++uZa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841 a2a += 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 if ( uZa >= (signed int)*pIndoor->pMapVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845 HIWORD(pIndoor->pMapVertices[a2a + 3]) = v11 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14846 pIndoor->_visible_outlines[uZa >> 3] |= 1 << (7 - uZa % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14847 v7 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14848 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 if ( v80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 && v75 >= 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851 && ((v12 = (int)&v7[*((short *)v8 + 2)], *(int *)(v12 + 44) & 0x2000000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852 || v7[*((short *)v8 + 3)].uAttributes & 0x2000000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 && (pIndoor->pFaceExtras[*(short *)(v12 + 72)].uEventID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 || pIndoor->pFaceExtras[v7[*((short *)v8 + 3)].uFaceExtraID].uEventID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855 && (v13 = uNumBlueFacesInBLVMinimap, (signed int)uNumBlueFacesInBLVMinimap < 49) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap] = uZa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 uNumBlueFacesInBLVMinimap = v13 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14860 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14862 v69 = uWidth
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14863 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14864 * (signed __int64)pIndoor->pVertices[*(short *)v8].x) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865 - uZoom * pParty->vPosition.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 lPitcha = uHeight
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14868 * (signed __int64)pIndoor->pVertices[*(short *)v8].y) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14869 - uZoom * pParty->vPosition.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14870 uWa = uWidth
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 * (signed __int64)pIndoor->pVertices[*((short *)v8 + 1)].x) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 - uZoom * pParty->vPosition.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 v14 = uHeight
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 * (signed __int64)pIndoor->pVertices[*((short *)v8 + 1)].y) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14877 - uZoom * pParty->vPosition.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14878 v15 = abs(*((short *)v8 + 4) - pParty->vPosition.y) / 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14879 if ( v15 > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14880 v15 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14881 pRenderer->FillRect(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 v7 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 for ( uZb = 0; uZb < (signed int)uNumBlueFacesInBLVMinimap; ++uZb )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 v16 = &pIndoor->pMapVertices[3 * pBlueFacesInBLVMinimapIDs[uZb] + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890 pRenderer->FillRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 uWidth
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14892 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14893 * (signed __int64)pIndoor->pVertices[*(short *)v16].x) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14894 - uZoom * pParty->vPosition.x) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14895 uHeight
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14896 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14897 * (signed __int64)pIndoor->pVertices[*(short *)v16].y) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14898 - uZoom * pParty->vPosition.z) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14899 uWidth
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 * (signed __int64)pIndoor->pVertices[HIWORD(pIndoor->pMapVertices[3 * pBlueFacesInBLVMinimapIDs[uZb] + 1])].x) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14902 - uZoom * pParty->vPosition.x) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14903 uHeight
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14904 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905 * (signed __int64)pIndoor->pVertices[HIWORD(pIndoor->pMapVertices[3 * pBlueFacesInBLVMinimapIDs[uZb] + 1])].y) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 - uZoom * pParty->vPosition.z) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14907 uBlue);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14909 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 v34 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) < 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915 if ( (signed int)v34 <= 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920 if ( (signed int)v34 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 if ( (signed int)v34 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 if ( (signed int)v34 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14926 if ( (signed int)v34 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 if ( (signed int)v34 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14930 if ( (signed int)v34 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14931 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14932 v57 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14936 v57 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14941 v57 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14944 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946 v57 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 v57 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 v57 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958 v35 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 LABEL_66:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 uWidth - 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 uHeight - 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 (Texture *)(pTextureIDs_pMapDirs[v35] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v35]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966 v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 if ( v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 uZe = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 a2c = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 if ( !*((short *)a2c - 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 || !*(short *)a2c
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977 || v75 == 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 || (v37 = ((unsigned __int64)((*(int *)(a2c + 2) - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14979 + uWidth,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 v79 = (unsigned __int64)((*(int *)(a2c + 6) - pParty->vPosition.z) * (signed __int64)(signed int)uZoom) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 v38 = uHeight - v79,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14982 v37 < pRenderer->field_1C_clipx)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 || v37 > pRenderer->field_24_clipz
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 || v38 < pRenderer->field_20_clipy
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14985 || v38 > pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14986 goto LABEL_83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14987 if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14991 pRenderer->FillRect(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14992 pRenderer->FillRect(v37, v38 - 2, v37, v38 + 1, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993 pRenderer->FillRect(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994 pRenderer->FillRect(v37 - 2, v38, v37 - 2, v38 + 1, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14995 v37 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14996 v58 = flagsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14997 v55 = v38 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 goto LABEL_81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15000 pRenderer->FillRect(v37 - 1, v38 - 1, v37 - 1, uHeight - v79, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15001 v58 = flagsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15002 v55 = uHeight - v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 v53 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004 v51 = v38 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15005 LABEL_82:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 pRenderer->FillRect(v37, v51, v53, v55, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007 LABEL_83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 ++uZe;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009 a2c += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010 if ( uZe >= (signed int)uNumLayingItems )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15017 v58 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15018 v55 = uHeight - v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15019 LABEL_81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 v53 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 v51 = uHeight - v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15022 goto LABEL_82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15024 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, 0, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026 v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 v65 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 uZf = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 if ( (signed int)uNumActors > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 flagsc = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15032 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034 v39 = *(short *)flagsc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035 if ( *(short *)flagsc != 11 && v39 != 19 && (v39 == 5 || *(flagsc - 139) & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037 v40 = ((unsigned __int64)(((signed int)*((short *)flagsc - 17) - pParty->vPosition.x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 * (signed __int64)(signed int)uZoom) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15039 + uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15040 v76 = (unsigned __int64)(((signed int)*((short *)flagsc - 16) - pParty->vPosition.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15041 * (signed __int64)(signed int)uZoom) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15042 v41 = uHeight - v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 if ( v40 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 if ( v40 <= pRenderer->field_24_clipz && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15047 uWd = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15048 if ( *(flagsc - 137) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15049 uWd = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15050 if ( *(short *)flagsc == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15051 uWd = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15052 if ( (signed int)uZoom > 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15054 pRenderer->FillRect(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15055 pRenderer->FillRect(v40, v41 - 2, v40, v41 + 2, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15056 pRenderer->FillRect(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15057 v42 = v41 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15058 v43 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15059 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15060 pRenderer->FillRect(v40 - 2, v43, v40 - 2, v42, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15061 v40 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15062 v59 = uWd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15063 v56 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15064 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15065 v52 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15067 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15068 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15069 pRenderer->FillRect(v40 - 1, v41 - 1, v40 - 1, uHeight - v76, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15070 v59 = uWd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15071 v56 = uHeight - v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15072 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15073 v52 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15075 pRenderer->FillRect(v40, v52, v54, v56, v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15079 ++uZf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15080 flagsc += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15082 while ( uZf < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15083 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15084 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15087 flagsd = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15088 uZg = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15089 if ( (signed int)uNumLevelDecorations > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15091 v45 = (char *)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15092 lPitchb = (char *)&pLevelDecorations[0].vPosition;
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 ( *(v45 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15097 v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15098 + uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15099 v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.z) * (signed __int64)(signed int)uZoom) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15100 v47 = uHeight - v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15101 if ( v46 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15103 if ( v46 <= pRenderer->field_24_clipz && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15105 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15107 v48 = v47 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15108 v49 = v47 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15109 pRenderer->FillRect(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15110 pRenderer->FillRect(v46, v49, v46, v48, flagsd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15111 pRenderer->FillRect(v46 + 1, v49, v46 + 1, v48, flagsd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15112 v45 = lPitchb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15114 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15116 pRenderer->FillRect(v46, uHeight - v77, v46, uHeight - v77, flagsd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15121 ++uZg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15122 v45 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15123 lPitchb = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15125 while ( uZg < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15126 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 v33,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15131 (Texture *)(dword_5079D8 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079D8] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132 uZooma = (double)pParty->sRotationY * 0.1171875;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15133 v50 = uZooma + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15134 pRenderer->Clip(0x21Du, v33, 0x237u, 0x1E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15135 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15136 LODWORD(v50) + 285,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15137 0x88u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15138 (Texture *)(dword_5079B4 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079B4] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15139 pRenderer->ResetClip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 //----- (00442955) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15144 int __fastcall DrawSpellbook_Map_sub(unsigned int x, unsigned int y, unsigned int a4, int a5, int _48074)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 unsigned int *v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15149 unsigned __int8 v8; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 unsigned __int8 v9; // sf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15151 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15152 unsigned int v11; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 __int16 v12; // cx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 signed int v13; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 Vec3_short_ *v15; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15157 int v16; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15158 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15159 Vec3_short_ *v18; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15160 int v19; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161 int v20; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162 signed int v21; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163 int v22; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165 Vec3_short_ *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 Vec3_short_ *v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 int v26; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 unsigned __int16 *v27; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 int v28; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170 int v29; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171 double v30; // st7@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172 signed __int64 v31; // qax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173 char *v32; // edx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 int v33; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175 signed int v34; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176 signed int v35; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177 int v36; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 int v37; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 int v38; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180 unsigned int v39; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181 const void *v40; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182 unsigned __int16 *v41; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183 unsigned __int8 v42; // cf@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 unsigned int v43; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185 int v44; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186 int v45; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 int v46; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15188 signed int v47; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15189 signed int v48; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15190 int v49; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15191 signed int v50; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15192 unsigned int v51; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 int result; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15194 int v53; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15195 int v54; // esi@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15196 int v55; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15197 __int16 v56; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15198 double v57; // st7@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 int v58; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 signed __int64 v59; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 signed int v60; // edi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15202 signed __int64 v61; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15203 signed int v62; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15204 signed int v63; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15205 int v64; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 unsigned int v65; // ebx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 char *v66; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208 unsigned __int16 *v67; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209 int v68; // edi@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 unsigned __int16 v69; // cx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 unsigned int v70; // [sp-10h] [bp-48074h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212 unsigned int v71; // [sp-Ch] [bp-48070h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 unsigned int v72; // [sp-8h] [bp-4806Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214 signed int v73; // [sp-4h] [bp-48068h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216 char v75; // [sp+Ch] [bp-48058h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217 int v76; // [sp+4800Ch] [bp-58h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 unsigned __int16 *v78; // [sp+48014h] [bp-50h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 unsigned int v79; // [sp+48018h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 unsigned int y_; // [sp+4801Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 int v81; // [sp+48020h] [bp-44h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 unsigned int x_; // [sp+48024h] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 unsigned int teal; // [sp+48028h] [bp-3Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225 int v84; // [sp+4802Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 int v85; // [sp+48030h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227 int v86; // [sp+48034h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 int v87; // [sp+48038h] [bp-2Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 int black; // [sp+48040h] [bp-24h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 int v90; // [sp+48044h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232 unsigned int i; // [sp+48048h] [bp-1Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233 unsigned int v92; // [sp+4804Ch] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 unsigned int v94; // [sp+48054h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236 unsigned int v95; // [sp+48058h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 int v96; // [sp+4805Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 const void *v97; // [sp+48060h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 char *a4a; // [sp+4806Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15240 int a5a; // [sp+48070h] [bp+Ch]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242 x_ = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243 y_ = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 v85 = (signed int)(x + a4) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15245 v90 = (signed int)(y + a5) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15246 v79 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15247 pRenderer->Clip_v2(x, y, a4, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 v5 = viewparams->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15249 v6 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15250 v86 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15251 v84 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15252 if ( viewparams->field_2C != 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15254 if ( viewparams->field_2C == 768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15257 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 v5 = 680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 v94 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 v92 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 v93 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266 v95 = (unsigned int)pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15267 v78 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268 v87 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15270 black = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 v96 = 32768 - black - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274 v31 = (signed __int64)((double)v96 / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275 v32 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 v33 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15277 v34 = (int)v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15278 v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15279 black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 v76 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15281 v35 = v34 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15282 if ( v95 && (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15284 v96 = v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15285 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15287 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15288 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15290 v36 = v95 + v35 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 i = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292 v88 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15293 v37 = black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15294 v77 = (unsigned __int16 *)v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15295 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15297 *(short *)v32 = v78[*((char *)v77 + v37)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15298 v32 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15299 v97 = (char *)v97 + v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15300 v37 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 --i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 while ( i );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15305 v34 += v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15306 v97 = (const void *)teal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15307 black = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 v32 += 2 * (v94 - v88);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309 v35 = v34 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15310 --v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15312 while ( v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15313 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15314 v97 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15315 if ( (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15317 v96 = v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15318 v38 = 2 * (v79 - v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15323 v39 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15324 v40 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15325 v41 = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15326 v42 = v94 & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15327 v43 = v94 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15328 memcpy(v93, v97, 4 * (v94 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15329 v45 = (int)((char *)v40 + 4 * v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15330 v44 = (int)&v41[2 * v43];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15331 v46 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15332 v39 *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15333 v93 = (unsigned __int16 *)((char *)v93 + v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15334 v97 = (char *)v97 + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15335 while ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15337 *(short *)v44 = *(short *)v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15338 v45 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15339 v44 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15340 --v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15342 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15344 v93 = (unsigned __int16 *)((char *)v93 + v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15345 --v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15347 while ( v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15349 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15351 v6 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15352 v86 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15353 v84 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15354 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15355 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15356 v5 = viewparams->field_2C - 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15357 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15358 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15359 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15360 v7 = pIndoor->pMapVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15361 uNumBlueFacesInBLVMinimap = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15362 v8 = *pIndoor->pMapVertices == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15363 v9 = (*pIndoor->pMapVertices & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15364 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15365 if ( !(v9 | v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15367 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15368 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15370 v10 = (int)((char *)v7 + i + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15371 v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15372 if ( BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15373 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15374 v12 = *(short *)((char *)v7 + i + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15375 if ( !(v12 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15377 if ( !(v96 & 0x80) && (v11 & 0x80u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15378 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15379 v96 = (signed int)v94 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 v13 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 *(short *)(v10 + 10) = v12 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 v14 = *(short *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 v88 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386 v15 = &pIndoor->pVertices[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 v16 = v15->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15388 v17 = v15->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389 v93 = (unsigned __int16 *)(v16 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 v92 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 v19 = v18->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393 v20 = v18->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15394 v95 = v19 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 v97 = (const void *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 v87 = (unsigned __int64)((signed int)v92 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 v92 = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 pRenderer->FillRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401 v85 + v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 v90 - v87,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15404 v90 - v92,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15405 black);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15406 v7 = pIndoor->pMapVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15407 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15408 ++v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15409 i += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15411 while ( (signed int)v94 < (signed int)*v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15413 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15414 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15416 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15418 v22 = pBlueFacesInBLVMinimapIDs[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15419 v87 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15420 v23 = (int)&v7[3 * v22 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15421 v24 = &pIndoor->pVertices[*(short *)v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15422 v25 = &pIndoor->pVertices[*(short *)(v23 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15423 v26 = v25->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15424 v27 = (unsigned __int16 *)(v24->x - v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15425 v28 = v24->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15426 v29 = v25->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15427 v93 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15428 v92 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15429 v97 = (const void *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15430 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15431 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15432 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15433 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15434 pRenderer->FillRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15435 v85 + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15436 v90 - v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15437 v85 + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15438 v90 - v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15439 teal);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15440 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15441 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15442 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15443 v7 = pIndoor->pMapVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15445 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15447 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15448 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15449 v81 = pParty->vPosition.z - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15450 v97 = (const void *)((unsigned __int64)((pParty->vPosition.z - v84) * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15451 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15452 v49 = v90 - (int)v97 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15453 if ( v47 >= (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15455 if ( v47 > (signed int)a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15457 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 6) > (signed int)a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15458 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15459 v47 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15462 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15464 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85) < (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15465 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15466 v47 = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15468 if ( v49 >= (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15470 if ( v49 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15472 if ( v90 - (signed int)v97 - 6 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15473 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15474 v49 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15477 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15479 if ( v90 - (signed int)v97 < (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15480 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15481 v49 = y_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15483 if ( v48 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15485 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15486 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15487 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15489 if ( (signed int)v51 > 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15491 if ( (signed int)v51 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15493 if ( (signed int)v51 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15495 if ( (signed int)v51 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15497 if ( (signed int)v51 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15499 if ( (signed int)v51 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15501 if ( (signed int)v51 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15502 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15503 v73 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15505 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15507 v73 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15510 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15512 v73 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15515 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15517 v73 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15520 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15522 v73 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15525 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15527 v73 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15529 v50 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15530 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15532 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15534 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15535 pRenderer->_4A6776(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15536 v47,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15537 v49,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15538 (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15540 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15541 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15542 v86 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15543 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15545 v94 = (unsigned int)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15546 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15548 if ( *(char *)(v94 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15550 v53 = *(int *)(v94 + 4) - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15551 v93 = (unsigned __int16 *)(*(int *)v94 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15552 v92 = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15553 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15554 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15555 v55 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15556 if ( v54 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15558 if ( v54 <= pRenderer->field_24_clipz && v55 >= pRenderer->field_20_clipy && v55 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15560 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15561 if ( v5 > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15563 v96 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15564 black = v55 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15565 pRenderer->FillRect(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15566 pRenderer->FillRect(v54, black, v54, v96, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15567 ++v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15568 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15569 v72 = v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15570 v71 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15571 v70 = black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15573 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15575 v72 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15576 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15577 v70 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15579 pRenderer->FillRect(v54, v70, v71, v72, v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15583 ++v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15584 result = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15585 v94 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15587 while ( (signed int)v95 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15589 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15591 v90 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15592 v95 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 v77 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 black = (1 << (v56 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15596 v57 = (double)(1 << (16 - v56));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15597 v58 = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15598 v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15599 v60 = (int)v59 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15600 v97 = (const void *)((int)v59 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15601 v61 = (signed __int64)((double)(32768 - v58 - v84) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15602 v78 = (unsigned __int16 *)(v60 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15603 v62 = (int)v61 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15604 teal = v60 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15605 v63 = (signed __int16)v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15606 a4a = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15607 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15608 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15609 for ( i = result; v85 < (signed int)v95; result = v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15611 a5a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15612 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15614 v96 = (v63 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15615 v64 = teal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15616 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15618 v81 = (v64 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15619 if ( !pOutdoor->_47F04C(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15621 if ( pOutdoor->_47F097(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623 if ( !((a5a + v85) % 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15624 *(short *)a4a = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628 *(short *)a4a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15631 a4a += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15632 v97 = (char *)v97 + black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 v64 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15634 ++a5a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 while ( a5a < v90 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638 v62 += black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639 v97 = (const void *)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15640 a4a += 2 * (v90 - a5a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 v63 = v62 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15642 ++v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643 teal = (unsigned int)v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 v65 = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 v66 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 if ( (signed int)v95 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649 v67 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 result = 2 * (v79 - v90);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15651 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15653 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 v68 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658 v69 = *(short *)v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659 if ( !*(short *)v66 || v69 == (short)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660 *v67 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661 v66 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 ++v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15663 --v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 while ( v68 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667 v67 = (unsigned __int16 *)((char *)v67 + result);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 --v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 while ( v65 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 //----- (00443219) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 int ViewingParams::_443219()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 this->sPartyPosZ += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 //----- (00443225) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 int ViewingParams::_443225()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 this->sPartyPosX -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690 //----- (00443231) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 int ViewingParams::_443231()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 this->sPartyPosZ -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 //----- (0044323D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 int ViewingParams::_44323D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700 this->sPartyPosX += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 //----- (00443249) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 int ViewingParams::_443249()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15708
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709 v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 if ( v1 < 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 this->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 this->sPartyPosX = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 this->sPartyPosZ = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 //----- (00443291) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719 int ViewingParams::_443291()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 v1 = 2 * this->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 v2 = 1536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 v2 = 3072;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 if ( v1 > v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 this->field_2C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 this->sPartyPosX = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 this->sPartyPosZ = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15735
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 //----- (004432E7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 int ViewingParams::_4432E7()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15741 signed int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743 int v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744 int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 int v7; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 int result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 v2 = this->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 v3 = 88 >> this->field_2C / 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 v4 = (44 - v3) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15752 if ( v1->sPartyPosZ > v2 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753 v1->sPartyPosZ = v2 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 v5 = v1->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 v6 = (v3 - 44) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756 if ( v1->sPartyPosX < v5 + v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 v1->sPartyPosX = v5 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15758 v7 = v2 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 if ( v1->sPartyPosZ < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 v1->sPartyPosZ = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 result = v5 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 if ( v1->sPartyPosX > v5 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763 v1->sPartyPosX = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 //----- (00443343) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 unsigned int ViewingParams::_443343()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771 unsigned __int16 *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775 v2 = this->pPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 *v2 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 while ( v1 < 256 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787 //----- (00443365) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788 int ViewingParams::_443365()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 __int16 *v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 Vec3_short_ *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 unsigned int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 signed int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 Vec3_short_ *v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 signed int v7; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 signed int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 char v9; // zf@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799 int result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 unsigned int v11; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801 unsigned int *v12; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 unsigned int v13; // [sp+Ch] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 unsigned int v14; // [sp+10h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804 unsigned int v15; // [sp+14h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805 unsigned int v16; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806 unsigned int v17; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809 _443343();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 v16 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 v14 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 v17 = 0xC0000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815 v15 = 0xC0000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 if ( (signed int)*pIndoor->pMapVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 v2 = (__int16 *)(pIndoor->pMapVertices + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 v11 = *pIndoor->pMapVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 v12 = pIndoor->pMapVertices + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823 v3 = &pIndoor->pVertices[*v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 v4 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 if ( (signed int)v4 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 v16 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 if ( (signed int)v4 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828 v17 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829 v5 = v3->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830 v13 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831 if ( v5 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832 v14 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15833 if ( v5 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834 v15 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 v6 = &pIndoor->pVertices[v2[1]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 v7 = v6->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837 if ( v7 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15838 v16 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 if ( v7 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 v17 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15841 v8 = v6->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15842 if ( v8 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15843 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15844 if ( v8 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 v15 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 v2 = (__int16 *)(v12 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 v9 = v11-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 v12 += 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15850 while ( !v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852 v1->uMinimapZoom = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 v1->field_38 = (signed int)(v16 + v17) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 v1->field_28 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15855 result = (signed int)(v14 + v15) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 v1->field_3A = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 v1->field_38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 v1->field_3A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862 v1->uMinimapZoom = dword_576E2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 result = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 v1->field_28 = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866 v1->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15867 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15869
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 //----- (00443801) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872 int __cdecl Initialize2DA()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 const char *v0; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 _2devent *v1; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876 char *v2; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 int v3; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 char v4; // cl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 int v6; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 int v7; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15882 int result; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 signed int v9; // [sp+10h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884 signed int v10; // [sp+14h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886 int it = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 if ( p2DEventsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 pAllocator->FreeChunk(p2DEventsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 p2DEventsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 p2DEventsTXT_Raw = (char *)pEvents_LOD->LoadRaw("2dEvents.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 strtok(p2DEventsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 v1 = p2DEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 v2 = strtok(0, v0) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15899 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 v3 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 v9 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 v4 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906 while ( v4 != 9 && v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 v4 = v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 v6 = (int)&v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 if ( !v2[v5] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 *(char *)v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15917 switch ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15920 if ( _strnicmp(v2, "wea", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15922 if ( _strnicmp(v2, "arm", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 if ( _strnicmp(v2, "mag", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926 if ( _strnicmp(v2, "alc", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 if ( _strnicmp(v2, "sta", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930 if ( _strnicmp(v2, "boa", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15932 if ( _strnicmp(v2, "tem", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934 if ( _strnicmp(v2, "tra", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 if ( _strnicmp(v2, "tow", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 if ( _strnicmp(v2, "tav", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15940 if ( _strnicmp(v2, "ban", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15942 if ( _strnicmp(v2, "fir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 if ( _strnicmp(v2, "air", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 if ( _strnicmp(v2, "wat", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 if ( _strnicmp(v2, "ear", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 if ( _strnicmp(v2, "spi", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 if ( _strnicmp(v2, "min", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 if ( _strnicmp(v2, "bod", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 if ( _strnicmp(v2, "lig", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15958 if ( _strnicmp(v2, "dar", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960 if ( _strnicmp(v2, "ele", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15962 if ( _strnicmp(v2, "sel", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964 if ( _strnicmp(v2, "mir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966 v7 = -(_strnicmp(v2, "mer", 3u) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 LOBYTE(v7) = v7 & 0xEE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 v1->uType = v7 + 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 v1->uType = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 v1->uType = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978 }
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 v1->uType = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 v1->uType = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 v1->uType = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 v1->uType = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002 v1->uType = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 v1->uType = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 v1->uType = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 v1->uType = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16022 v1->uType = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16025 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16027 v1->uType = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16030 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16032 v1->uType = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16035 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16037 v1->uType = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16040 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16042 v1->uType = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16045 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16047 v1->uType = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16050 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16052 v1->uType = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16055 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16057 v1->uType = 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16060 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16062 v1->uType = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16065 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16067 v1->uType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16070 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16072 v1->uType = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16075 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16077 v1->uType = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16080 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16082 v1->uType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16084 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16085 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16086 v1->uAnimationID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16087 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16088 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16089 v1->pName = (char *)RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16090 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16091 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16092 v1->pProprieterName = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16093 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16094 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16095 v1->pProprieterTitle = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16096 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16097 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16098 v1->field_14 = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16099 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16100 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16101 v1->_state = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16102 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16103 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16104 v1->_rep = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16105 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16106 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16107 v1->_per = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16108 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16109 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16110 v1->fPriceMultiplier = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16111 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16112 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16113 v1->flt_24 = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16114 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16115 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16116 v1->field_1C = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16117 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16118 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16119 v1->uOpenTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16120 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16121 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16122 v1->uCloseTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16123 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16124 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16125 v1->uExitPicID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16126 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16127 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16128 v1->uExitMapID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16129 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16130 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16131 v1->_quest_related = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16132 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16133 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16134 v1->pEnterText = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16135 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16136 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16137 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16140 v2 = (char *)(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16141 v3 = v9 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16142 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16143 result = v3 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16145 while ( v3 + 1 <= 23 && !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16146 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16147 //if ( (signed int)v1 >= (signed int)&unk_597F10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16148 if (++it >= 525)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16149 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16150 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16153
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16154 //----- (00443CE1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16155 unsigned int __fastcall LoadEventsToBuffer(const char *pContainerName, char *a2, unsigned int uBufferSize)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16157 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16158 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16159 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16160 char Args; // [sp+8h] [bp-B4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16161 //Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16162 void *Dst; // [sp+B4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16163 void *ptr; // [sp+B8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16165 v3 = pContainerName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16166 Dst = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16167 ptr = pEvents_LOD->LoadRaw(pContainerName, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16169 Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16170 //Texture::Texture(&DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16172 v4 = pEvents_LOD->FindContainer(v3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16173 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16174 Abortf("Unable to load %s", v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16175 fread(&DstBuf, 1u, 0x30u, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16176 v5 = DstBuf.uDecompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16177 if ( !DstBuf.uDecompressedSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16178 v5 = DstBuf.uTextureSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16179 memset(&DstBuf, 0, 0x48u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16180 if ( (signed int)v5 >= (signed int)uBufferSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16182 sprintfex(&Args, "File %s Size %lu - Buffer size %lu", v3, v5, uBufferSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16183 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16185 memcpy(Dst, ptr, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16186 pAllocator->FreeChunk(ptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16187 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16190 //----- (00443DA1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16191 void __cdecl Initialize_GlobalEVT()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16193 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16194 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16195 char *v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16196
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16197 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16198 uGlobalEVT_Size = LoadEventsToBuffer("global.evt", pGlobalEVT, 0xB400u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16199 if ( uGlobalEVT_Size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16201 uGlobalEVT_NumEvents = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16202 memset(pGlobalEVT_Events, 128, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16203 v1 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16204 v2 = (char *)&pGlobalEVT_Events[uGlobalEVT_NumEvents].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16205 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16207 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16208 *((int *)v2 - 1) = (unsigned __int8)pGlobalEVT[v0 + 1] + ((unsigned __int8)pGlobalEVT[v0 + 2] << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16209 *(int *)v2 = (unsigned __int8)pGlobalEVT[v0 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16210 *((int *)v2 + 1) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16211 v2 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16212 v0 += (unsigned __int8)pGlobalEVT[v0] + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16214 while ( v0 < (signed int)uGlobalEVT_Size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16215 uGlobalEVT_NumEvents = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16218
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16219 //----- (00443E31) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16220 void __cdecl LoadLevel_InitializeLevelStr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16222 signed __int16 v0; // si@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16223 unsigned int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16224 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16225 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16226 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16227 int v5; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16228 int v6; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16229 int v7; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16230 unsigned int *v8; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16231 char Args[100]; // [sp+Ch] [bp-68h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16232 int v10; // [sp+70h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16234 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16235 memset(pLevelStrOffsets, 0, 0x7D0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16236 v1 = uLevelStrFileSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16237 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16238 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16239 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16240 if ( (signed int)uLevelStrFileSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16242 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16243 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16245 if ( !pLevelStr[v4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16247 v5 = (signed __int16)v2++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16248 pLevelStrOffsets[v5] = v4 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16249 if ( (signed __int16)(v3 - (short)v10) > v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16250 v0 = v3 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16251 v10 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16253 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16254 v4 = (signed __int16)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16255 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16256 while ( (signed __int16)v3 < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16258 uLevelStrNumStrings = (signed __int16)v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16259 if ( v0 > 800 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16261 sprintfex(Args, "MAX_EVENT_TEXT_LENGTH needs to be increased to %lu", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16262 Abortf(Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16264 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16265 if ( (signed __int16)v2 - 1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16267 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16268 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16270 v8 = &pLevelStrOffsets[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16271 if ( RemoveQuotes(&pLevelStr[*v8]) != &pLevelStr[*v8] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16272 ++*v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16273 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16274 v7 = (signed __int16)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16276 while ( (signed __int16)v6 < (signed int)uLevelStrNumStrings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16279
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16280 //----- (00443EF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16281 void __cdecl LoadLevel_InitializeLevelEvt()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16283 int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16284 unsigned int v1; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16285 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16286 unsigned int v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16288 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16289 if ( uLevelEVT_Size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16291 memset(array_5B5928, 0, 0xC80u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16292 uLevelEVT_NumEvents = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16293 dword_5B65C8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16294 memset(pLevelEVT_Events, 128, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16295 v1 = uLevelEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16296 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16297 v3 = 12 * uLevelEVT_NumEvents + 5989852;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16298 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16300 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16301 *(int *)(v3 - 4) = (unsigned __int8)pLevelEVT[v2 + 1] + ((unsigned __int8)pLevelEVT[v2 + 2] << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16302 *(int *)v3 = (unsigned __int8)pLevelEVT[v2 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16303 *(int *)(v3 + 4) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16304 LOWORD(v2) = (unsigned __int8)pLevelEVT[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16305 v3 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16306 v0 += v2 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16307 v2 = (signed __int16)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16309 while ( (signed __int16)v0 < (signed int)uLevelEVT_Size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16310 uLevelEVT_NumEvents = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16313 // 5B65C8: using guessed type int dword_5B65C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16315 //----- (00443F95) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16316 void __cdecl OnMapLeave()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16318 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16319 char *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16320 int v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16322 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16323 if ( (signed int)uLevelEVT_NumEvents > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16325 v1 = (char *)&pLevelEVT_Events[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16326 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16328 if ( pLevelEVT[*((short *)v1 + 2) + 4] == 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16330 v2 = *((int *)v1 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16331 dword_597F18 = *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16332 EventProcessor(v2, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16333 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16335 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16336 v1 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16338 while ( v0 < (signed int)uLevelEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16341 // 597F18: using guessed type int dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16342
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16343 //----- (00443FDC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16344 void OnMapLoad()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16346 signed __int64 v0; // qax@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16347 int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16348 Event *v2; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16349 stru176 *v3; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16350 __int16 v4; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16351 __int16 v5; // di@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16352 int v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16353 int v7; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16354 signed __int64 v8; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16355 unsigned int v9; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16356 signed __int64 v10; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16357 signed __int64 v11; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16358 int v12; // ST50_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16359 signed __int64 v13; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16360 signed __int64 v14; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16361 int v15; // ST58_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16362 signed __int64 v16; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16363 int v17; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16364 unsigned __int64 v18; // [sp+Ch] [bp-44h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16365 signed __int64 v19; // [sp+14h] [bp-3Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16366 unsigned __int64 v20; // [sp+1Ch] [bp-34h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16367 Event *v21; // [sp+28h] [bp-28h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16368 int v22; // [sp+2Ch] [bp-24h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16369 signed int v23; // [sp+30h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16370 int v24; // [sp+34h] [bp-1Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16371 int v25; // [sp+38h] [bp-18h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16372 int v26; // [sp+3Ch] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16373 int v27; // [sp+3Ch] [bp-14h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16374 int v28; // [sp+40h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16375 __int16 v29; // [sp+46h] [bp-Ah]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16376 __int16 v30; // [sp+48h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16377 __int16 v31; // [sp+4Ah] [bp-6h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16378 __int16 v32; // [sp+4Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16379 __int16 v33; // [sp+4Eh] [bp-2h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16380
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16381 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16382 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16383 if ( (signed int)uLevelEVT_NumEvents > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16385 v2 = pLevelEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16386 v21 = pLevelEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16387 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16389 LODWORD(v0) = LOWORD(v2->uEventOffsetInEVT);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16390 if ( (unsigned __int8)pLevelEVT[(int)v0 + 4] == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16392 pSoundList->_4A9A67(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16393 (unsigned __int8)pLevelEVT[(int)v0 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16394 + (((unsigned __int8)pLevelEVT[(int)v0 + 6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16395 + (((unsigned __int8)pLevelEVT[(int)v0 + 7] + ((unsigned __int8)pLevelEVT[(int)v0 + 8] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16396 v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16397 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16399 if ( (unsigned __int8)pLevelEVT[(int)v0 + 4] == 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16400 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16401 if ( (unsigned __int8)pLevelEVT[(int)v0 + 4] == 37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16403 v7 = v2->uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16404 dword_597F18 = v2->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16405 EventProcessor(v7, 0, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16406 dword_597F18 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16408 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16410 if ( (unsigned __int8)pLevelEVT[(int)v0 + 4] == 38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16411 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16413 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16414 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16415 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16416 v21 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16417 if ( v23 >= (signed int)uLevelEVT_NumEvents )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16418 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16420 v20 = pOutdoor->uLastVisitDay;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16421 v3 = &array_5B5928[dword_5B65C8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16422 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16423 v20 = pIndoor->uLastVisitDay;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16424 v4 = (unsigned __int8)pLevelEVT[(int)v0 + 4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16425 WORD2(v0) = LOWORD(v2->uEventID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16426 *(short *)&v3->field_18[4] = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16427 v3->field_8 = WORD2(v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16428 v3->field_A = LOWORD(v2->field_4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16429 v33 = (unsigned __int8)pLevelEVT[(int)v0 + 6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16430 v3->field_12 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16431 v32 = (unsigned __int8)pLevelEVT[(int)v0 + 7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16432 v3->field_14 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16433 v31 = (unsigned __int8)pLevelEVT[(int)v0 + 8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16434 v3->field_16 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16435 v5 = (unsigned __int8)pLevelEVT[(int)v0 + 5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16436 v30 = (unsigned __int8)pLevelEVT[(int)v0 + 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16437 *(short *)&v3->field_18[0] = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16438 v29 = (unsigned __int8)pLevelEVT[(int)v0 + 10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16439 *(short *)&v3->field_18[2] = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16440 WORD2(v0) = (unsigned __int8)pLevelEVT[(int)v0 + 12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16441 LOWORD(v0) = (unsigned __int8)pLevelEVT[(int)v0 + 11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16442 v6 = (HIDWORD(v0) << 8) + v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16443 v3->field_10 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16444 v3->field_C = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16445 v3->field_E = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16446 if ( v4 == 38 && !(short)v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16448 if ( v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16449 v18 = pParty->uTimePlayed - v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16450 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16451 v18 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16452 v26 = (signed int)(signed __int64)((double)(signed __int64)v18 * 0.234375) / 60 / 60 / 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16453 HIDWORD(v0) = v26 / 7 / 4 % 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16454 if ( v26 / 7 / 4 / 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16456 LODWORD(v0) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16457 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16459 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16460 v3->field_4 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16461 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16462 ++dword_5B65C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16463 v3->field_0 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16464 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16465 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16468 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16470 LODWORD(v0) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16472 if ( v26 / 7 / 4 != (int)v0 && v33 != (short)v0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16473 || v26 / 7 != (int)v0 && v32 != (short)v0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16474 || v26 != (int)v0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16475 || !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16476 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16478 v8 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16479 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16480 v10 = (signed int)v8 / 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16481 v22 = v10 % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16482 v11 = (signed int)(v10 / 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16483 v12 = v11 % 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16484 v13 = (signed int)(v11 / 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16485 v27 = v13 % 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16486 v14 = (signed int)(v13 / 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16487 v15 = v14 % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16488 v16 = (signed int)(v14 / 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16489 v24 = v16 / 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16490
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16491 auto _1 = (unsigned __int64)((double)pParty->uTimePlayed * 0.234375) >> 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16492 auto _2 = ((__int64)v9 << 32) | _1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16493 v19 = _2 % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16494 //v19 = (signed __int64)__PAIR__((unsigned __int64)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) >> 32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16495 // v9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16496 // % 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16497 v17 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16498 v25 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16499 v28 = v16 % 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16500 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16502 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16504 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16506 if ( v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16508 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16510 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16512 if ( v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16514 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16516 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16518 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16519 v22 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16520 v17 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16521 v19 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16525 v0 = (signed __int64)((double)((v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16526 + 0x3C * v22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16527 + 0xE10 * v17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16528 + 0x93A80 * v25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16529 + 0x15180 * v27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16530 + 0x24EA00 * (v28 + 12i64 * v24)) << 7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16531 * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16532 v2 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16533 v3->field_4 = HIDWORD(v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16534 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16537 // 597F18: using guessed type int dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16538 // 5B65C8: using guessed type int dword_5B65C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16539
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16540 //----- (00444360) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16541 void __thiscall Level_LoadEvtAndStr(const char *pLevelName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16543 const char *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16544 char pContainerName[120]; // [sp+8h] [bp-98h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16545
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16546 v1 = pLevelName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16547 sprintfex(pContainerName, "%s.evt", pLevelName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16548 uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT, 0x2400u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16549 sprintfex(pContainerName, "%s.str", v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16550 uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr, 0x2400u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16551 if ( uLevelStrFileSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16552 LoadLevel_InitializeLevelStr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16553 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16554
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16555 //----- (004443D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16556 char *__cdecl _4443D5_GetMinimapRightClickText()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16558 int v0; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16559 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16560 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16561 double v3; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16562 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16563 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16564 int v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16565 int v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16566 BSPModel *v8; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16567 unsigned __int8 v9; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16568 char v10; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16569 unsigned __int8 v11; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16570 ODMFace *v12; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16571 __int16 v13; // cx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16572 const char *v14; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16573 const char *v15; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16574 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16575 unsigned int v17; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16576 unsigned int v18; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16577 int v19; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16578 int v20; // [sp+14h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16579 char *v21; // [sp+18h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16580 unsigned int pY; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16581 int v23; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16582 int v24; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16583 int pX; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16585 v24 = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16586 v0 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16587 v1 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16588 *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16589 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16590 v18 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16591 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16592 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16593 v3 = 1.0 / *(float *)&v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16594 v23 = pX - 557;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16595 v19 = (signed __int64)((double)(pX - 557) * v3 + (double)v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16596 v20 = (signed __int64)((double)v0 - (double)(signed int)(pY - 74) * v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16597 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || (*(float *)&v23 = 0.0, (signed int)v1 <= 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16599 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16600 v17 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16601 if ( v17 == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16602 result = "No Maze Info for this maze on file!";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16603 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16604 result = pMapStats->pInfos[v17].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16606 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16608 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16609 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16611 pX = pOutdoor->pBModels[v4].vBoundingCenter.x - v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16612 pY = pOutdoor->pBModels[v4].vBoundingCenter.y - v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16613 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16614 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16615 v7 = sub_4621DA(v6, v5, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16616 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16617 if ( v7 < 2 * pOutdoor->pBModels[v4].sBoundingRadius )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16619 v11 = __OFSUB__(pOutdoor->pBModels[v4].uNumFaces, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16620 v9 = pOutdoor->pBModels[v4].uNumFaces == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16621 v10 = ((pOutdoor->pBModels[v4].uNumFaces - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16622 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16623 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16625 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16627 v12 = &v8[v4].pFaces[v2 / 0x134u];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16628 v13 = v12->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16629 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16631 if ( !(BYTE2(v12->uFaceAttributes) & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16633 v14 = _444732_GetEventHintString(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16634 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16635 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16637 if ( _strcmpi(v14, nullstring) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16638 v21 = (char *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16642 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16643 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16644 v2 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16646 while ( v24 < (signed int)pOutdoor->pBModels[v4].uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16648 result = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16649 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16650 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16651 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16653 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16654 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16655 if ( v23 >= (signed int)v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16656 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16659 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16662 //----- (00444564) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16663 const char *__cdecl sub_444564()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16665 double v0; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16666 int v1; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16667 int v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16668 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16669 int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16670 int v5; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16671 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16672 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16673 BSPModel *v8; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16674 unsigned __int8 v9; // zf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16675 unsigned __int8 v10; // sf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16676 ODMFace *v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16677 __int16 v12; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16678 const char *v13; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16679 const char *v14; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16680 const char *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16681 unsigned int v16; // [sp+0h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16682 const char *v17; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16683 unsigned int pY; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16684 float v19; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16685 int v20; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16686 int v21; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16687 unsigned int v22; // [sp+18h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16688 int pX; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16689
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16690 v20 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16691 v21 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16692 v19 = (double)viewparams->field_2C * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16693 if ( viewparams->field_2C == 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16695 v20 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16696 v21 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16698 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16699 v16 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16700 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16701 v0 = 1.0 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16702 v1 = (signed __int64)((double)(pX - 229) * v0 + (double)v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16703 LODWORD(v19) = (signed __int64)((double)v21 - (double)(signed int)(pY - 181) * v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16704 v2 = abs(v1 + 22528) / 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16705 v3 = abs((signed)LODWORD(v19) - 22528);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16706 if ( pOutdoor->_47F04C(v2, v3 / 512)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16707 && uCurrentlyLoadedLevelType == LEVEL_Outdoor
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16708 && (v4 = 0, v20 = 0, (signed int)v16 > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16710 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16712 pX = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.x + v4) - v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16713 pY = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.y + v4) - LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16714 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16715 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16716 v7 = sub_4621DA(v6, v5, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16717 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16718 if ( v7 < *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16720 v9 = *(unsigned int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16721 v10 = *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16722 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16723 if ( !(v10 | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16725 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16726 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16728 v11 = &(*(ODMFace **)((char *)&v8->pFaces + v4))[v22 / 0x134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16729 v12 = v11->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16730 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16732 if ( !(BYTE2(v11->uFaceAttributes) & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16734 v13 = _444732_GetEventHintString(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16735 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16736 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16738 if ( _strcmpi(v13, nullstring) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16739 v17 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16743 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16744 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16745 v22 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16747 while ( v21 < *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16749 result = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16750 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16751 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16753 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16754 v4 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16755 if ( v20 >= (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16756 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16758 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16759 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16761 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16762 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16764 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16766
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16769
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16770 //----- (00444A51) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16771 char *__cdecl TransitionUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16773 MapInfo *v0; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16774 char *v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16775 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16776 std::string v3; // [sp-18h] [bp-84h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16777 unsigned int v4; // [sp-10h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16778 int v5; // [sp-Ch] [bp-78h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16779 const char *v6; // [sp-8h] [bp-74h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16780 signed int v7; // [sp-4h] [bp-70h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16781 GUIWindow v8; // [sp+Ch] [bp-60h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16782 unsigned int v9; // [sp+60h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16783 unsigned int v10; // [sp+64h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16784 int a3; // [sp+6Bh] [bp-1h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16785
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16786 memcpy(&v8, pGUIWindow0, sizeof(v8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16787 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16788 v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16789 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16790 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16791 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16792 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16793 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16794 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16795 uTextureID_507B04 = uTextureID_right_panel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16796 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16797 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16798 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16799 (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16800 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16801 0x22Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16802 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16803 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16804 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16805 0x1DCu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16806 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16807 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16808 if ( (pVideoPlayer->AnyMovieLoaded() || v9) && *dword_591164_teleport_map_name != 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16809 v10 = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16810 v0 = &pMapStats->pInfos[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16811 v8.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16812 v8.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16813 v8.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16814 v8.DrawText2(pFontCreate, 0, 5u, 0, v0->pName, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16815 v8.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16816 v8.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16817 v8.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16818 if ( uCurrentHouse_Animation )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16820 v1 = (&off_4EB080)[4 * uCurrentHouse_Animation];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16821 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16822 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16824 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16826 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[409], v0->pName);// "Do you wish to leave %s?"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16827 v1 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16828 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16830 v1 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16832 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16833 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16834 MessageBoxW(nullptr, L"No transition text found!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1410", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16835 v1 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16837 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16838 v7 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16839 v6 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16840 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16841 v4 = (212 - pFontCreate->CalcTextHeight(v1, &v8, 0, 0)) / 2 + 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16842 result = v8.DrawText2(pFontCreate, 0, v4, v5, v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16843 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16844 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16846
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16848 //----- (00444C8F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16849 GUIWindow *__cdecl UI_CreateTravelDialogue()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16851 signed int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16852 unsigned int v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16853 GUIWindow *result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16854 const char *v3; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16855 char pContainer[32]; // [sp+0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16856
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16857 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16858 v0 = const_2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16859 sprintfex(pContainer, "evt%02d", v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16860 if ( pParty->uAlignment )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16862 if ( pParty->uAlignment != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16863 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16864 v3 = "-c";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16866 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16868 v3 = "-b";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16870 strcat(pContainer, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16871 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16872 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16873 pTexture_outside = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("outside", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16874 v1 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16875 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16876 sprintfex(byte_591098, pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16877 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16878 strcpy(byte_591098, pGlobalTXT_LocalizationStrings[79]);// "Exit"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16879 result = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, (enum WindowType)17, 0, (int)byte_591098);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16880 pDialogueWindow = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16881 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16883
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16884 //----- (00444D80) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16885 signed int __cdecl GetTravelTime()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16887 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16888
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16889 v0 = uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16890 if ( CheckHiredNPCSpeciality(5u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16891 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16892 if ( CheckHiredNPCSpeciality(6u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16893 v0 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16894 if ( CheckHiredNPCSpeciality(7u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16895 v0 -= 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16896 if ( CheckHiredNPCSpeciality(0x2Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16897 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16898 if ( v0 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16899 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16900 return v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16902 // 6BD07C: using guessed type int uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16903
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16904 //----- (00444DCA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16905 void __cdecl TravelUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16907 unsigned int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16908 MapInfo *v1; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16909 char *v2; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16910 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16911 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16912 const char *v5; // [sp-Ch] [bp-90h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16913 signed int v6; // [sp-8h] [bp-8Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16914 GUIWindow v7; // [sp+Ch] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16915 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16916 unsigned int v9; // [sp+80h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16917
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16918 memcpy(&v7, pGUIWindow0, sizeof(v7));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16919 v9 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16920 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.z, pDestinationMapName, 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16921 v0 = pMapStats->GetMapInfo(pDestinationMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16922 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16923 pRenderer->DrawTextureTransparent(0x1D4u, 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16924 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16925 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16926 pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16927 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16928 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16929 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16930 if ( v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16932 v1 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16933 v7.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16934 v7.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16935 v2 = v1->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16936 v7.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16937 v7.DrawText2(pFontCreate, 0, 4u, 0, v2, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16938 v7.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16939 v7.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16940 v7.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16941 v3 = GetTravelTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16942 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16944 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16945 v5 = pGlobalTXT_LocalizationStrings[663]; // "It will take %d day to cross to %s."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16946 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16947 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16949 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16950 v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16952 sprintfex(pTmpBuf, v5, v6, v1->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16953 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16954 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16955 strcat(pTmpBuf, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16956 v4 = pFontCreate->CalcTextHeight(pTmpBuf, &v7, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16957 v7.DrawText2(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16958 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16961
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16962
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16963 //----- (00444FBE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16964 void __cdecl DrawBranchlessDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16966 GUIFont *v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16967 int v1; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16968 char *v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16969 int v3; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16970 char Str[200]; // [sp+Ch] [bp-120h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16971 GUIWindow v5; // [sp+D4h] [bp-58h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16972 GUIFont *pFont; // [sp+128h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16973
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16974 v0 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16975 pFont = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16976 if ( ptr_F8B1E8 && !byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16977 strcpy(byte_5B0938, ptr_F8B1E8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16978 v5.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16979 v5.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16980 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16981 if ( 352 - v1 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16983 pFont = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16984 v1 = pFontCreate->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16986 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16987 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16988 352 - v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16989 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16990 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16991 pRenderer->DrawTextureIndexed(8u, 347 - v1, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16992 v2 = FitTextInAWindow(byte_5B0938, pFont, &v5, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16993 pGUIWindow2->DrawText(pFont, 12, 354 - v1, 0, v2, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16994 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16995 if ( pGUIWindow2->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16997 if ( pGUIWindow2->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16999 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17000 strcpy(GameUI_StatusBar_TimedString, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17001 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17002 sub_4452BB();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17003 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17005 if ( pGUIWindow2->field_40 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17006 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17007 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17008 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17009 memset(GameUI_StatusBar_TimedString, 0, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17010 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17012 if ( pGUIWindow2->ptr_1C == (void *)26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17014 sprintfex(Str, "%s %s", GameUI_StatusBar_TimedString, pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17015 v3 = pFontLucida->GetLineWidth(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17016 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17017 pGUIWindow2->DrawFlashingInputCursor(v3 + 13, 357, pFontLucida);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17018 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17020 if ( pKeyActionMap->pPressedKeysBuffer[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17022 pKeyActionMap->_459ED1(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17023 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17027 //----- (004451A8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17028 void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17030 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17031 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17033 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17034 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17035 if ( !pGUIWindow2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17037 if ( pParty->uFlags & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17038 pGame->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17039 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17040 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17041 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17042 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17043 dword_5C3418 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17044 dword_5C341C = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17045 _591094_decoration = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17046 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)19, a4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17047 pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17048 pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17049 pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17050 pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17053
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17054 //----- (004452BB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17055 void __cdecl sub_4452BB()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17057 pGUIWindow2->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17058 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17059 _5C3420_pDecoration = _591094_decoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17060 dword_597F18 = dword_5C341C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17061 EventProcessor(dword_5C3418, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17062 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17063 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17064 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17066
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17067
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17068 //----- (00445308) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17069 int __fastcall sub_445308(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17071 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17072
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17073 if ( a1 == 10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17074 || a1 == 11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17075 || a1 == 12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17076 || a1 == 33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17077 || a1 == 34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17078 || a1 == 39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17079 || a1 == 40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17080 || a1 == 41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17081 || a1 == 42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17082 || a1 == 43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17083 || a1 == 52 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17084 result = *(&pNPCStats->field_13A60 + 5 * a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17085 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17086 result = dword_722320;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17087 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17089 // 722320: using guessed type int dword_722320;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17090
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17091 //----- (00445350) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17092 void __cdecl DrawDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17094 NPCData *v0; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17095 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17096 unsigned __int16 v2; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17097 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17098 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17099 int v5; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17100 char *v6; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17101 char *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17102 unsigned int v8; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17103 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17104 char *v10; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17105 int v11; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17106 int v12; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17107 char *v13; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17108 GUIButton *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17109 GUIButton *v15; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17110 signed int v16; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17111 int v17; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17112 int v18; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17113 int v19; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17114 int v20; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17115 int v21; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17116 int v22; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17117 unsigned int v23; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17118 const char *v24; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17119 int v25; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17120 int v26; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17121 int v27; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17122 int v28; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17123 int v29; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17124 unsigned __int16 v30; // cx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17125 int v31; // ecx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17126 int v32; // ebx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17127 unsigned int v33; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17128 GUIWindow *v34; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17129 int v35; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17130 int i; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17131 GUIButton *v37; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17132 int v38; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17133 signed int v39; // esi@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17134 signed int v40; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17135 unsigned int v41; // ebx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17136 int v42; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17137 GUIButton *v43; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17138 int v44; // eax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17139 unsigned int v45; // ecx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17140 unsigned __int16 *v46; // edx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17141 unsigned __int16 v47; // ax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17142 char pFont; // [sp+4h] [bp-110h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17143 int v49; // [sp+Ch] [bp-108h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17144 int v50; // [sp+14h] [bp-100h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17145 GUIWindow v51; // [sp+58h] [bp-BCh]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17146 GUIWindow v52; // [sp+ACh] [bp-68h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17147 char *Str; // [sp+100h] [bp-14h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17148 __int16 v54[2]; // [sp+104h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17149 unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17150 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17151 char *pInString; // [sp+110h] [bp-4h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17153 if ( !pDialogueWindow )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17154 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17155 memcpy(&v51, pDialogueWindow, sizeof(v51));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17156 v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17157 v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17158 v51.uFrameWidth -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17159 v51.uFrameZ -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17160 *(int *)v54 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17161 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17162 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17163 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17164 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17165 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17166 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17167 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17168 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17169 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17170 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17171 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17172 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17173 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17174 v3 = v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17175 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17177 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17178 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v0->pName, aNPCProfessionNames[v3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17180 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17182 strcpy(pTmpBuf, v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17183 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17185 v51.DrawText2(pFontArrus, 0x1E3u, 0x70u, v2, v4, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17186 pParty->GetPartyFame();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17187 if ( (signed int)uDialogueType > 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17189 if ( uDialogueType == 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17191 v7 = pGlobalTXT_LocalizationStrings[577]; // "Get back in there you wimps:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17192 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17194 if ( uDialogueType == 91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17196 sprintfex(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17197 pInString = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17198 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17199 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17201 if ( uDialogueType == 92 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17203 v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17204 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17207 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17209 if ( uDialogueType == 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17211 v7 = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17212 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17214 if ( uDialogueType == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17216 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17217 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17219 if ( (signed int)uDialogueType > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17221 if ( (signed int)uDialogueType > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17223 if ( uDialogueType == 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17225 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17226 if ( byte_F8B1EC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17228 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17229 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17231 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17233 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17234 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17235 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17236 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17237 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17238 pInString = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17239 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17241 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17242 v6 = (char *)*(&pNPCStats->field_13A64 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17243 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17245 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17247 if ( byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17248 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17249 v7 = ptr_F8B1E8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17250 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17251 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17252 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17255 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17256 if ( *(int *)v54 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17258 v11 = v0->greet;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17259 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17260 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17262 v10 = (char *)*(&pNPCStats->field_17884 + ((v0->uFlags & 3) == 2) + 2 * v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17263 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17266 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17268 if ( *(int *)v54 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17270 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17271 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17272 v9 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17273 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17274 v9 = (char *)*(&pNPCStats->field_13A64 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17275 v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17276 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17277 pInString = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17278 if ( v10 == (char *)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17279 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17280 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17281 v49 = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17282 v50 = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17283 pOutString = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17284 v12 = pFontArrus->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17285 if ( 352 - v12 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17287 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17288 v12 = pFontCreate->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17290 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17291 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17292 352 - v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17293 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17294 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17295 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17296 v13 = FitTextInAWindow(pInString, pOutString, (GUIWindow *)&pFont, 0xDu, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17297 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17298 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17301 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17302 memcpy(&v52, pDialogueWindow, sizeof(v52));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17303 v52.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17304 v52.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17305 v52.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17306 for ( pOutString = (GUIFont *)v52.field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17307 (signed int)pOutString < v52.field_38 + v52.field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17308 pOutString = (GUIFont *)((char *)pOutString + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17310 v14 = v52.GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17311 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17312 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17313 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17314 v16 = v14->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17315 if ( v16 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17317 v25 = v16 - 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17318 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17320 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17321 if ( v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17323 v27 = v26 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17324 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17326 v28 = v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17327 if ( v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17329 v29 = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17330 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17332 if ( v29 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17333 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17334 v24 = pGlobalTXT_LocalizationStrings[581];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17336 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17338 v24 = pGlobalTXT_LocalizationStrings[580];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17341 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17343 v24 = pGlobalTXT_LocalizationStrings[579];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17346 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17348 v24 = pGlobalTXT_LocalizationStrings[578];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17351 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17353 v24 = pGlobalTXT_LocalizationStrings[407];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17356 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17358 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17360 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17361 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[408], v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17362 v24 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17363 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17365 v24 = pGlobalTXT_LocalizationStrings[406];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17368 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17370 if ( v16 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17372 v23 = v0->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17373 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17374 v24 = (&dword_721660)[8 * v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17375 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17377 v24 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17378 v15->uControlParam = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17380 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17382 v17 = v16 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17383 if ( !v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17385 v24 = (const char *)sub_445308(v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17386 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17388 v18 = v17 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17389 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17391 v19 = v18 - 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17392 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17394 v23 = v0->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17395 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17397 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17398 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17400 v23 = v0->evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17401 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17403 v21 = v20 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17404 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17406 v23 = v0->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17407 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17409 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17410 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17412 v23 = v0->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17413 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17415 if ( v22 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17417 v23 = v0->evte;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17418 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17420 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17421 v24 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17422 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17424 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17425 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17426 v24 = pGlobalTXT_LocalizationStrings[122];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17428 LABEL_79:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17429 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17431 pInString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17432 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17434 v55 = &pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17435 *(int *)v54 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17436 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17438 v30 = *v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17439 if ( *v55 == 5 || v30 == 11 || v30 == 19 || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17440 ++pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17441 v55 += 418;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17442 --*(int *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17444 while ( *(int *)v54 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17446 if ( pInString == (char *)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17447 v24 = pGlobalTXT_LocalizationStrings[658];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17448 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17449 strcpy(v15->pButtonName, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17451 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17452 pInString = (char *)GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17453 v33 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17454 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17455 *(int *)v54 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17456 v35 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17457 for ( i = v35 + pDialogueWindow->field_28; v35 < i; i = pDialogueWindow->field_28 + pDialogueWindow->field_38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17459 v37 = v34->GetControl(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17460 if ( !v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17462 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17463 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17465 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17466 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17467 v32 += v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17468 ++v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17470 v39 = v34->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17471 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17473 pOutString = (GUIFont *)((174 - v32) / v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17474 if ( (174 - v32) / v39 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17475 pOutString = (GUIFont *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17476 v55 = (unsigned __int16 *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17477 v40 = 174 - (int)pOutString * v39 - v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17478 v41 = v34->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17479 v42 = v40 / 2 - (signed int)pOutString / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17480 if ( (signed int)v41 < (signed int)(v41 + v39) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17482 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17484 v43 = v34->GetControl(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17485 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17486 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17487 v43->uY = (unsigned int)((char *)pOutString + v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17488 Str = v43->pButtonName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17489 v44 = pFontArrus->CalcTextHeight(v43->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17490 v45 = v43->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17491 v46 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17492 v43->uHeight = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17493 v42 = v45 + v44 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17494 v43->uW = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17495 v47 = v54[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17496 if ( (unsigned __int16 *)pDialogueWindow->field_2C_focus_id != v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17497 v47 = (unsigned __int16)pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17498 v52.DrawText2(pFontArrus, 0, v45, v47, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17499 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17500 v55 = (unsigned __int16 *)((char *)v55 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17501 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17503 while ( (signed int)v41 < pDialogueWindow->field_28 + pDialogueWindow->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17506 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17507 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17508 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17509 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17511
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17512 //----- (004459F9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17513 NPCData *__fastcall GetNPCData(unsigned int npcid)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17515 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17516 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17517 int v3; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17518 int v4; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17519 int v5; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17520 NPCData *v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17521 char *v7; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17522 NPCData *v8; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17523 char v9; // al@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17524 std::string v10; // [sp-18h] [bp-2Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17525 const char *v11; // [sp-8h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17526 int v12; // [sp-4h] [bp-18h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17527 std::string *v13; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17528 int a3; // [sp+13h] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17529
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17530 v1 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17531 if ( (npcid & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17533 if ( (signed int)npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17535 if ( (signed int)npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17537 MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1984", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17539 return &pNPCStats->pNewNPCData[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17541 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17543 if ( (signed int)npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17544 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17545 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17547 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17548 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17549 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17551 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17552 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17553 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17554 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17555 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17557 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17558 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17559 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17560 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17562 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17563 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17564 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17566 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17567 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17568 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17570 if ( v8->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17571 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17572 && (!pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17573 *v7++ = (char)v13 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17574 v13 = (std::string *)((char *)v13 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17575 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17577 while ( (signed int)v13 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17579 v9 = pTmpBuf[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17580 if ( (unsigned __int8)v9 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17581 result = &pNPCStats->pNPCData[(unsigned __int8)v9 + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17582 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17583 result = &pParty->pHirelings[(unsigned __int8)v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17585 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17587
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17588 //----- (00445B2C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17589 NPCData *__fastcall GetNewNPCData(signed int npcid, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17591 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17592 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17593 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17594 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17595 int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17596 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17597 NPCData *v8; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17598 NPCData *v9; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17599 int v10; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17600 char v11; // al@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17601 std::string v12; // [sp-18h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17602 const char *v13; // [sp-8h] [bp-24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17603 int v14; // [sp-4h] [bp-20h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17604 std::string *v15; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17605 char *v16; // [sp+10h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17606 int v17; // [sp+14h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17607 int a3; // [sp+1Bh] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17608
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17609 v2 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17610 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17611 v15 = (std::string *)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17612 if ( npcid >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17614 if ( npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17616 if ( npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17618 MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:2040", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17620 *(int *)v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17621 return &pNPCStats->pNewNPCData[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17623 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17624 *(int *)a2 = npcid - 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17625 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17627 if ( npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17628 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17629 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17631 *(int *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17632 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17634 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17636 v5 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17637 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17638 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17639 v8 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17640 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17642 if ( v8->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17643 pTmpBuf[v6++] = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17644 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17645 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17647 while ( (signed int)v8 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17648 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17649 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17651 v9 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17652 v16 = &pTmpBuf[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17653 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17655 if ( v9->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17656 && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17657 && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17659 v10 = (int)v16++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17660 *(char *)v10 = v17 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17662 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17663 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17665 while ( v17 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17666 v3 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17668 v11 = pTmpBuf[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17669 if ( (unsigned __int8)v11 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17671 *(int *)v3 = (unsigned __int8)v11 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17672 result = &pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[v5] + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17674 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17676 *(int *)v3 = (unsigned __int8)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17677 result = &pParty->pHirelings[(unsigned __int8)pTmpBuf[v5]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17680 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17682
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17683 //----- (00445C8B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17684 int __fastcall sub_445C8B(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17686 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17687 int v3; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17688 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17689 int v5; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17690 NPCData *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17691 char *v7; // ebp@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17692 NPCData *v8; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17694 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17695 if ( a1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17697 if ( a1 < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17698 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17699 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17701 if ( a1 >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17702 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17703 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17704 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17705 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17706 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17707 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17709 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17710 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17711 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17712 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17714 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17715 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17717 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17718 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17719 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17721 if ( v8->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17723 if ( !pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17724 *v7++ = v1 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17726 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17727 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17729 while ( v1 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17731 return ((unsigned __int8)pTmpBuf[v3] < 2u) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17733
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17734
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17735 //----- (0044603D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17736 void __cdecl sub_44603D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17738 uDialogue_SpeakingActorNPC_ID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17739 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17740 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17741 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17742 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17744
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17745
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17746 //----- (004465DF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17747 signed int __thiscall sub_4465DF_check_season(void *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17749 unsigned int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17750 unsigned int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17751 char *v3; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17752 int v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17753 char v6; // zf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17754
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17755 v1 = pParty->uCurrentMonth + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17756 v2 = pParty->uDaysPlayed + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17757 if ( _this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17759 v3 = (char *)_this - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17760 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17762 v4 = (int)(v3 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17763 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17765 if ( v4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17766 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17767 if ( v1 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17769 if ( (signed int)v1 >= 1 && (signed int)v1 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17770 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17771 v6 = v1 == 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17772 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17773 if ( !v6 || (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17774 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17775 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17778 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17780 if ( v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17782 if ( (signed int)v1 >= 10 && (signed int)v1 <= 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17783 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17784 v6 = v1 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17785 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17789 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17791 if ( v1 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17793 if ( (signed int)v1 >= 7 && (signed int)v1 <= 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17794 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17795 v6 = v1 == 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17796 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17800 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17802 if ( v1 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17803 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17804 if ( (signed int)v1 >= 4 && (signed int)v1 <= 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17805 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17806 v6 = v1 == 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17807 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17810 if ( (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17811 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17812 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17815 //----- (0044665D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17816 // uType: 0 -> any monster
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17817 // 1 -> uParam is GroupID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17818 // 2 -> uParam is MonsterID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17819 // 3 -> uParam is ActorID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17820 // uNumAlive: 0 -> all must be alive
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17821 int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17823 unsigned int uAliveActors; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17824 int v5; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17825 unsigned int uTotalActors; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17826
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17827 uTotalActors = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17828 if ( uType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17830 if ( uType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17832 uAliveActors = SearchActorByGroup(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17834 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17836 if ( uType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17838 uAliveActors = SearchActorByMonsterID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17840 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17842 if ( uType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17843 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17844 uAliveActors = SearchActorByID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17848 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17850 uAliveActors = SearchAliveActors(&uTotalActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17852 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17853 if ( uNumAlive )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17854 LOBYTE(v5) = (signed int)uAliveActors >= (signed int)uNumAlive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17855 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17856 LOBYTE(v5) = uTotalActors == uAliveActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17857 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17859
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17860 //----- (004466C4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17861 bool __thiscall sub_4466C4(void *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17863 signed int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17864 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17865 int v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17866 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17867 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17868 unsigned int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17869 char *v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17870 signed int v8; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17871 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17872 Player *v10; // [sp+8h] [bp-10h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17873 signed int v11; // [sp+Ch] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17874 signed int v12; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17875 void *v13; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17876
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17877 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17878 v13 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17879 if ( !_this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17880 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17881 v3 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17882 pSomeOtherEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17883 uSomeOtherEVT_NumEvents = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17884 memcpy(pSomeOtherEVT_Events, pGlobalEVT_Events, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17885 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17886 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17887 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17888 if ( (signed int)uSomeOtherEVT_NumEvents <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17889 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17890 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17892 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17893 if ( (void *)pSomeOtherEVT_Events[v1].uEventID == v13 && pSomeOtherEVT_Events[v5].field_4 == v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17895 v6 = pSomeOtherEVT_Events[v5].uEventOffsetInEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17896 v7 = &pSomeOtherEVT[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17897 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17898 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17899 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17901 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17902 v10 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17903 v8 = (unsigned __int8)v7[7]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17904 + (((unsigned __int8)v7[8] + (((unsigned __int8)v7[9] + ((unsigned __int8)v7[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17905 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17907 LOBYTE(v9) = v10->CompareVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17908 (enum VariableType)((unsigned __int8)pSomeOtherEVT[v6 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17909 + ((unsigned __int8)pSomeOtherEVT[v6 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17910 v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17911 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17912 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17913 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17914 if ( (signed int)v10 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17915 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17918 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17920 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17921 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17922 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17924 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17925 v12 = (unsigned __int8)v7[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17926 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17928 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] != 52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17929 || !IsActorAlive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17930 (unsigned __int8)v7[5],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17931 (unsigned __int8)v7[6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17932 + (((unsigned __int8)v7[7] + (((unsigned __int8)v7[8] + ((unsigned __int8)v7[9] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17933 (unsigned __int8)v7[10]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17934 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17936 v1 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17937 v3 = (unsigned __int8)pSomeOtherEVT[v6 + 11] - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17938 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17939 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17940 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17942 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17944 while ( v1 < (signed int)uSomeOtherEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17945 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17946 result = v12 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17947 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17948 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17949 result = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17950 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17952
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17953
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17954 //----- (0044684A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17955 void __fastcall EventProcessor(int a1, int a2, int a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17957 unsigned int v3; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17958 signed int v4; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17959 char *v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17960 char *v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17961 char *v7; // ebp@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17962 signed int v8; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17963 int v9; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17964 ByteArray *v10; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17965 int v11; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17966 char *v12; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17967 char *v13; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17968 int v14; // ebp@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17969 int v15; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17970 const char *v16; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17971 bool v17; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17972 int v18; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17973 int v19; // ebp@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17974 signed int v20; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17975 int v21; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17976 int v22; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17977 int v23; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17978 unsigned __int16 v24; // ax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17979 int v25; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17980 LevelDecoration *v26; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17981 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17982 int v28; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17983 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17984 int v30; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17985 int v31; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17986 int v32; // esi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17987 NPCData *v33; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17988 int v34; // esi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17989 int v35; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17990 int v36; // esi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17991 int v37; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17992 int v38; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17993 int v39; // ecx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17994 size_t v40; // edx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17995 char *v41; // esi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17996 int v42; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17997 int v43; // ecx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17998 size_t v44; // edx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17999 char *v45; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18000 void *v46; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18001 GUIWindow *v47; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18002 GUIButton *v48; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18003 GUIButton *v49; // esi@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18004 char v50; // al@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18005 Player *v51; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18006 Player *v52; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18007 int v53; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18008 char v54; // al@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18009 Player *v55; // esi@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18010 Player *v56; // ecx@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18011 int v57; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18012 signed int v58; // ebp@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18013 Player *v59; // esi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18014 int v60; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18015 int v61; // edx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18016 int v62; // eax@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18017 void *v63; // ebp@145
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18018 signed int v64; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18019 unsigned int v65; // edx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18020 Player *v66; // ecx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18021 int v67; // esi@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18022 signed int v68; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18023 int v69; // esi@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18024 Player *v70; // ecx@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18025 unsigned int v71; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18026 int v72; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18027 signed int v73; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18028 int v74; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18029 int v75; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18030 Player *v76; // esi@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18031 signed int v77; // ebp@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18032 int v78; // edx@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18033 Player *v79; // esi@187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18034 signed int v80; // ebp@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18035 int v81; // edx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18036 Player *v82; // esi@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18037 int v83; // eax@212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18038 int v84; // ebp@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18039 signed int v85; // ebp@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18040 char v86; // al@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18041 Player *v87; // esi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18042 Player *v88; // ecx@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18043 int v89; // ecx@232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18044 int v90; // eax@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18045 const char *v91; // ecx@247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18046 int v92; // eax@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18047 char *v93; // eax@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18048 int v94; // ecx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18049 int v95; // ebp@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18050 int v96; // edx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18051 int v97; // eax@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18052 unsigned int v98; // edx@265
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18053 const char *v99; // esi@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18054 int v100; // edx@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18055 char *v101; // edi@281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18056 unsigned int v102; // esi@281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18057 int v103; // edi@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18058 int v104; // eax@288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18059 int v105; // edx@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18060 int v106; // [sp-20h] [bp-4C8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18061 signed int v107; // [sp-1Ch] [bp-4C4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18062 unsigned int v108; // [sp-18h] [bp-4C0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18063 signed int v109; // [sp-14h] [bp-4BCh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18064 signed int v110; // [sp-10h] [bp-4B8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18065 int v111; // [sp-Ch] [bp-4B4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18066 Event *v112; // [sp-8h] [bp-4B0h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18067 int v113; // [sp-8h] [bp-4B0h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18068 int v114; // [sp-8h] [bp-4B0h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18069 signed int v115; // [sp-8h] [bp-4B0h]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18070 unsigned int v116; // [sp-8h] [bp-4B0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18071 int v117; // [sp-4h] [bp-4ACh]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18072 int v118; // [sp-4h] [bp-4ACh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18073 int v119; // [sp-4h] [bp-4ACh]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18074 int v120; // [sp-4h] [bp-4ACh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18075 int v121; // [sp-4h] [bp-4ACh]@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18076 int v122; // [sp+10h] [bp-498h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18077 char *v123; // [sp+14h] [bp-494h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18078 signed int v124; // [sp+18h] [bp-490h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18079 signed int v125; // [sp+1Ch] [bp-48Ch]@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18080 int v126; // [sp+1Ch] [bp-48Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18081 int v127; // [sp+20h] [bp-488h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18082 int v128; // [sp+24h] [bp-484h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18083 int v129; // [sp+24h] [bp-484h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18084 signed int v130; // [sp+28h] [bp-480h]@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18085 int v131; // [sp+2Ch] [bp-47Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18086 int v132; // [sp+30h] [bp-478h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18087 signed int v133; // [sp+34h] [bp-474h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18088 int v134; // [sp+38h] [bp-470h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18089 int v135; // [sp+3Ch] [bp-46Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18090 int v136; // [sp+40h] [bp-468h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18091 int v137; // [sp+44h] [bp-464h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18092 int v138; // [sp+48h] [bp-460h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18093 int v139; // [sp+4Ch] [bp-45Ch]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18094 ItemGen item; // [sp+50h] [bp-458h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18095 char Source[120]; // [sp+74h] [bp-434h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18096 char Str[120]; // [sp+ECh] [bp-3BCh]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18097 Actor Dst; // [sp+164h] [bp-344h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18098
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18099 v131 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18100 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18101 dword_5B5920 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18102 dword_5B65C4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18103 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18105 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18106 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18107 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18109 v127 = 2 * (uActiveCharacter == 0) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18110 v122 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18111 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18113 v3 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18114 pSomeEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18115 v112 = pGlobalEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18117 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18118 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18119 v3 = uLevelEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18120 pSomeEVT = pLevelEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18121 v112 = pLevelEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18123 uSomeEVT_NumEvents = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18124 memcpy(pSomeEVT_Events, v112, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18125 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18126 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18127 if ( (signed int)uSomeEVT_NumEvents > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18129 v5 = pSomeEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18130 v6 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18131 v7 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18132 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18134 if ( dword_5B65C4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18135 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18136 v8 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18137 if ( pSomeEVT_Events[v4].uEventID == v131 && pSomeEVT_Events[v8].field_4 == v122 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18139 v9 = pSomeEVT_Events[v8].uEventOffsetInEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18140 v10 = (ByteArray *)&v5[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18141 switch ( v5[v9 + 4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18143 case EVENT_CheckSeason:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18144 if ( !sub_4465DF_check_season((void *)v10->f[5]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18145 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18146 v11 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18147 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18148 case EVENT_ShowMovie:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18149 strcpy(Source, &v10->f[7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18150 v12 = (char *)&item.uExpireTime + strlen(Source) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18151 if ( *v12 == 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18152 *v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18153 if ( pVideoPlayer->field_54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18154 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18155 pVideoPlayer->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18156 pVideoPlayer->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18157 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18158 pAsyncMouse->Suspend();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18159 v128 = 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
18160 v13 = &pSomeEVT[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18161 v14 = (unsigned __int8)v13[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18162 v15 = (unsigned __int8)v13[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18163 strcpy(Str, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18164 v16 = RemoveQuotes(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18165 VideoPlayer::MovieLoop(v16, 0, v14, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18166 if ( !_strcmpi(v16, "arbiter good") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18168 pParty->uAlignment = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18169 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18170 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18171 LOBYTE(v17) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18172 SetUserInterface(v18, v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18173 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18175 if ( !_strcmpi(v16, "arbiter evil") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18177 v18 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18178 pParty->uAlignment = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18179 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18181 if ( !_strcmpi(v16, "pcout01") ) // moving to harmondale from emerald isle
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18183 Rest(0x2760u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18184 pParty->RestAndHeal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18185 pParty->field_764 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18187 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18188 if ( !v15 || v128 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18190 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = v128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18191 if ( v128 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18192 pGameLoadingUI_ProgressBar->uType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18193 if ( v128 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18194 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18196 if ( pAsyncMouse )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18197 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18198 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18199 case EVENT_CheckSkill:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18200 v19 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18201 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18202 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18203 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18205 v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + v10->f[5]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18207 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18209 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18211 v24 = pPlayers[uActiveCharacter]->pActiveSkills[v10->f[5]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18213 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18215 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18217 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18218 v21 = 3486 * v130 + v10->f[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18219 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18220 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18221 v137 = v21 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18222 v138 = v21 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18223 v22 = v21 & 0x100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18224 v23 = v21 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18225 v139 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18226 while ( v23 < v19 || !*(&v136 + v10->f[6]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18228 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18229 if ( v20 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18230 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18232 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18233 v11 = v10->f[11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18234 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18236 LABEL_47:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18237 v10 = (ByteArray *)&v5[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18238 v24 = pParty->pPlayers[0].pActiveSkills[(unsigned __int8)v5[v9 + 5] + 3486 * rand() % 4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18241 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18242 v137 = v24 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18243 v138 = v24 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18244 v139 = v24 & 0x100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18245 if ( (v24 & 0x3F) >= v19 && *(&v136 + v10->f[6]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18246 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18247 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18248 case EVENT_SpeakNPC:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18249 if ( a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18251 //Actor::Actor(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18252 memset(&Dst, 0, 0x344u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18253 dword_5B65D0_dialogue_actor_npc_id = (unsigned __int8)pSomeEVT[v9 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18254 + (((unsigned __int8)pSomeEVT[v9 + 6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18255 + (((unsigned __int8)pSomeEVT[v9 + 7]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18256 + ((unsigned __int8)pSomeEVT[v9 + 8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18257 Dst.uNPC_ID = dword_5B65D0_dialogue_actor_npc_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18258 Dst.InitializeDialogue(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18260 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18262 bDialogueUI_InitializeActor_NPC_ID = v10->f[5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18263 + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18265 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18266 case EVENT_ChangeEvent:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18267 v25 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18268 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18270 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = v10->f[5] - 124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18272 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18274 v26 = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18275 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18276 LOBYTE(v26->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18278 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18279 case EVENT_SetNPCGreeting:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18280 v27 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18281 v28 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18282 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18283 pNPCStats->pNewNPCData[v27].greet = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18284 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18285 case EVENT_SetNPCTopic:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18286 v29 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18287 v30 = v10->f[10] + ((v10->f[11] + ((v10->f[12] + (v10->f[13] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18288 v31 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18289 v32 = v10->f[9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18290 v33 = &pNPCStats->pNewNPCData[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18291 if ( v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18293 v34 = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18294 if ( v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18296 v35 = v34 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18297 if ( v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18299 v36 = v35 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18300 if ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18302 v37 = v36 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18303 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18305 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18306 v33->evtf = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18308 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18310 v33->evte = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18313 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18315 v33->evtd = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18318 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18320 v33->evtc = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18323 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18325 v33->evtb = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18328 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18330 v33->bDrawSomeAnim = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18332 if ( v29 == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18334 if ( v30 == 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18336 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18337 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18338 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18339 if ( EnterHouse((enum HOUSE_TYPE)170) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18341 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18342 ptr_507BC0 = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_HouseInterior, 170, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18343 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18344 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18345 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18346 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18347 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18348 ptr_F8B1E8 = (char *)dword_72193C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18352 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18353 case EVENT_NPCSetItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18354 sub_448518_npc_set_item(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18355 v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18356 v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18357 v10->f[13]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18358 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18359 case EVENT_SetActorItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18360 Actor::GiveItem(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18361 v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18362 v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18363 v10->f[13]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18364 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18365 case EVENT_SetNPCGroupNews:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18366 pNPCStats->pGroups_copy[v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8)] = v10->f[9] + (v10->f[10] << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18367 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18368 case EVENT_SetActorGroup:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18369 *(&pActors[0].uGroup + 285212672 * v10->f[8] + 209 * (v10->f[5] + ((v10->f[6] + (v10->f[7] << 8)) << 8))) = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18370 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18371 case EVENT_ChangeGroup:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18372 v38 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18373 v39 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18374 v40 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18375 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18377 v41 = (char *)&pActors[0].uGroup;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18378 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18380 if ( *(int *)v41 == v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18381 *(int *)v41 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18382 v41 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18383 --v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18385 while ( v40 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18387 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18388 case EVENT_ChangeGroupAlly:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18389 v42 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18390 v43 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18391 v44 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18392 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18394 v45 = (char *)&pActors[0].uAlly;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18395 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18397 if ( *((int *)v45 - 1) == v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18398 *(int *)v45 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18399 v45 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18400 --v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18402 while ( v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18404 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18405 case EVENT_MoveNPC:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18406 pNPCStats->pNewNPCData[v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8)].house = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18407 if ( ptr_507BC0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18409 v46 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18410 if ( v46 == (void *)165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18412 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18413 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18414 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18415 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18416 _5C3420_pDecoration = (LevelDecoration *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18417 if ( EnterHouse((enum HOUSE_TYPE)165) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18419 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18420 v47 = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_HouseInterior, 165, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18421 ptr_507BC0 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18422 v48 = v47->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18423 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18425 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18427 v49 = v48->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18428 pAllocator->FreeChunk(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18429 v48 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18431 while ( v49 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18432 v47 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18434 v47->pControlsHead = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18435 ptr_507BC0->pControlsTail = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18436 ptr_507BC0->uNumControls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18439 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18441 if ( v46 == (void *)553 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18442 pVideoPlayer->bLoopPlaying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18445 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18446 case EVENT_Jmp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18447 v124 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18448 v122 = v10->f[5] - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18449 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18450 case EVENT_ShowFace:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18451 v50 = v10->f[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18452 if ( (unsigned __int8)v50 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18454 v117 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18455 v113 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18456 v53 = (unsigned __int8)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18457 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18459 if ( v50 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18461 v117 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18462 v113 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18463 v52 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18464 goto LABEL_109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18466 if ( v50 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18468 v117 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18469 v113 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18470 v53 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18471 LABEL_108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18472 v52 = &pParty->pPlayers[v53];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18473 LABEL_109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18474 v52->PlayEmotion(v113, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18475 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18477 v51 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18478 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18480 v51->PlayEmotion((unsigned __int8)pSomeEVT[v9 + 6], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18481 ++v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18483 while ( (signed int)v51 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18484 LABEL_291:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18485 ++v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18486 v4 = v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18487 v5 = pSomeEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18488 v6 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18489 v7 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18490 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18491 case EVENT_CharacterAnimation:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18492 v54 = v10->f[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18493 if ( (unsigned __int8)v54 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18495 v118 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18496 v114 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18497 v57 = (unsigned __int8)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18498 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18500 if ( v54 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18502 v118 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18503 v114 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18504 v56 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18505 goto LABEL_120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18507 if ( v54 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18509 v118 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18510 v114 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18511 v57 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18512 LABEL_119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18513 v56 = &pParty->pPlayers[v57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18514 LABEL_120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18515 v56->PlaySound(v114, v118);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18516 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18518 v55 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18519 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18521 v55->PlaySound((unsigned __int8)pSomeEVT[v9 + 6], 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18522 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18524 while ( (signed int)v55 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18525 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18526 case EVENT_ForPartyMember:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18527 v127 = v10->f[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18528 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18529 case EVENT_SummonItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18530 sub_42F7EB_DropItemAt(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18531 v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18532 v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18533 v10->f[13] + ((v10->f[14] + ((v10->f[15] + (v10->f[16] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18534 v10->f[17] + ((v10->f[18] + ((v10->f[19] + (v10->f[20] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18535 v10->f[21] + ((v10->f[22] + ((v10->f[23] + (v10->f[24] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18536 v10->f[25],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18537 v10->f[26],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18538 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18539 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18540 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18541 case EVENT_Compare:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18542 v58 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18543 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18545 v130 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18546 v59 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18547 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18549 LOBYTE(v60) = v59->CompareVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18550 (enum VariableType)((unsigned __int8)pSomeEVT[v9 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18551 + ((unsigned __int8)pSomeEVT[v9 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18552 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18553 if ( v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18554 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18555 ++v130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18556 ++v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18557 if ( (signed int)v59 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18558 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18560 LABEL_129:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18561 v11 = (unsigned __int8)pSomeEVT[v9 + 11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18562 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18564 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18565 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18566 v61 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18567 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18568 goto LABEL_137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18569 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18571 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18573 v6 = (char *)pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18574 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18577 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18579 if ( v127 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18580 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18582 v61 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18583 v5 = pSomeEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18584 LABEL_137:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18585 v6 = (char *)&pParty->pPlayers[v61];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18586 LABEL_138:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18587 v123 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18588 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18589 LOBYTE(v62) = ((Player *)v6)->CompareVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18590 (enum VariableType)((unsigned __int8)v5[v9 + 5] + ((unsigned __int8)v5[v9 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18591 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18592 LABEL_140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18593 if ( v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18594 goto LABEL_129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18595 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18596 case EVENT_IsActorAlive:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18597 v62 = IsActorAlive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18598 v10->f[5],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18599 v10->f[6] + ((v10->f[7] + ((v10->f[8] + (v10->f[9] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18600 v10->f[10]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18601 goto LABEL_140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18602 case EVENT_Substract:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18603 v63 = (void *)(v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18604 if ( v10->f[5] + (v10->f[6] << 8) == VAR_PlayerItemInHands )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18606 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18607 if ( (void *)pParty->pPickedItem.uItemID == v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18609 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18610 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18612 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18613 v66 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18614 v67 = (int)v66->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18615 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18617 if ( *(void **)&v66->pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18619 v66->RemoveItemAtInventoryIndex(v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18620 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18622 ++v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18623 v67 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18625 while ( (signed int)v65 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18626 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18627 v69 = (int)&v66->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18628 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18630 if ( *(int *)v69 && *(void **)&v66->pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18632 *(&v66->pEquipment.uOffHand + v68) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18633 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18635 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18636 v69 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18638 while ( v68 < 16 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18639 v125 = (signed int)&pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18640 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18642 v70 = *(Player **)v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18643 if ( !v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18645 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18646 v72 = (int)v70->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18647 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18648 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18649 if ( *(void **)&v70->pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v72 + 5] == v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18651 v70->RemoveItemAtInventoryIndex(v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18652 goto LABEL_169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18654 ++v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18655 v72 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18657 while ( (signed int)v71 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18658 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18659 v74 = (int)&v70->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18660 while ( !*(int *)v74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18661 || *(void **)&v70->pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v74 + 5] != v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18663 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18664 v74 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18665 if ( v73 >= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18666 goto LABEL_170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18668 *(&v70->pEquipment.uOffHand + v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18669 LABEL_169:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18670 v64 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18672 LABEL_170:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18673 v125 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18674 if ( v125 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18675 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18678 v75 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18679 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18681 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18682 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18683 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18685 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18687 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18688 goto LABEL_180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18689 LABEL_183:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18690 ((Player *)v6)->SubtractVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18691 (enum VariableType)((unsigned __int8)v5[v9 + 5] + ((unsigned __int8)v5[v9 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18692 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18693 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18695 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18697 v6 = (char *)pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18698 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18700 LABEL_180:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18701 v75 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18702 v5 = pSomeEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18704 v6 = (char *)&pParty->pPlayers[v75];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18705 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18706 v123 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18707 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18709 v76 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18710 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18711 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18712 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18713 v76->SubtractVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18714 (enum VariableType)((unsigned __int8)pSomeEVT[v9 + 5] + ((unsigned __int8)pSomeEVT[v9 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18715 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18716 ++v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18718 while ( (signed int)v76 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18719 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18720 case EVENT_Set:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18721 v77 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18722 v78 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18723 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18725 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18726 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18727 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18729 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18731 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18732 goto LABEL_194;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18733 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18734 ((Player *)v6)->SetVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18735 (enum VariableType)((unsigned __int8)v5[v9 + 5] + ((unsigned __int8)v5[v9 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18736 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18737 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18739 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18741 v6 = (char *)pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18742 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18744 LABEL_194:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18745 v78 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18746 v5 = pSomeEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18748 v6 = (char *)&pParty->pPlayers[v78];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18749 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18750 v123 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18751 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18753 v79 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18754 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18755 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18757 v79->SetVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18758 (enum VariableType)((unsigned __int8)pSomeEVT[v9 + 5] + ((unsigned __int8)pSomeEVT[v9 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18759 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18760 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18762 while ( (signed int)v79 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18763 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18764 case EVENT_Add:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18765 v80 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18766 v81 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18767 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18769 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18770 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18771 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18773 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18775 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18776 goto LABEL_208;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18777 LABEL_211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18778 ((Player *)v6)->AddVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18779 (enum VariableType)((unsigned __int8)v5[v9 + 5] + ((unsigned __int8)v5[v9 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18780 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18781 goto LABEL_212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18783 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18785 v6 = (char *)pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18786 goto LABEL_210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18788 LABEL_208:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18789 v81 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18790 v5 = pSomeEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18792 v6 = (char *)&pParty->pPlayers[v81];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18793 LABEL_210:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18794 v123 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18795 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18797 v82 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18798 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18799 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18801 v82->AddVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18802 (enum VariableType)((unsigned __int8)pSomeEVT[v9 + 5] + ((unsigned __int8)pSomeEVT[v9 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18803 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18804 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18806 while ( (signed int)v82 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18807 LABEL_212:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18808 v83 = (unsigned __int8)pSomeEVT[v9 + 5] + ((unsigned __int8)pSomeEVT[v9 + 6] << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18809 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18810 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18811 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18812 case EVENT_InputString:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18813 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18815 strcpy(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18816 GameUI_StatusBar_TimedString,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18817 &pLevelStr[pLevelStrOffsets[(unsigned __int8)v5[v9 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18818 + (((unsigned __int8)v5[v9 + 6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18819 + (((unsigned __int8)v5[v9 + 7] + ((unsigned __int8)v5[v9 + 8] << 8)) << 8)) << 8)]]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18820 v105 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18821 v121 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18822 LABEL_295:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18823 sub_4451A8_press_any_key(v131, v105, v121);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18824 LABEL_301:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18825 if ( v133 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18826 LABEL_302:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18827 OnMapLeave();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18828 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18830 v84 = v10->f[13] + ((v10->f[14] + ((v10->f[15] + (v10->f[16] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18831 if ( !_strcmpi(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18832 GameUI_StatusBar_TimedString,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18833 &pLevelStr[pLevelStrOffsets[v10->f[9]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18834 + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8)]])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18835 || !_strcmpi(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[v84]]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18837 v11 = (unsigned __int8)pSomeEVT[v9 + 17];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18838 LABEL_130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18839 v124 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18840 LABEL_131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18841 v122 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18843 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18844 case EVENT_RandomGoTo:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18845 v124 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18846 v11 = (unsigned __int8)*(&pSomeEVT[v9 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18847 + rand()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18848 % ((v10->f[5] != 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18849 + (v10->f[6] != 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18850 + (v10->f[7] != 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18851 + (v10->f[8] != 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18852 + (v10->f[9] != 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18853 + (v10->f[10] != 0)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18854 goto LABEL_131;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18855 case EVENT_ReceiveDamage:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18856 v85 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18857 v86 = v10->f[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18858 if ( (unsigned __int8)v86 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18860 v119 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18861 v115 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18862 v89 = (unsigned __int8)v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18863 goto LABEL_233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18865 if ( v86 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18867 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18868 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18869 v119 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18870 v88 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18871 v115 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18872 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18874 if ( v86 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18876 v119 = v10->f[6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18877 v115 = v10->f[7] + ((v10->f[8] + ((v10->f[9] + (v10->f[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18878 v89 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18879 LABEL_233:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18880 v88 = &pParty->pPlayers[v89];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18881 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18882 v88->ReceiveDamage(v115, v119);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18883 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18885 v87 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18886 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18888 v87->ReceiveDamage(v85, (unsigned __int8)pSomeEVT[v9 + 6]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18889 ++v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18891 while ( (signed int)v87 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18892 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18893 case EVENT_ToggleIndoorLight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18894 pIndoor->ToggleLight(v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), v10->f[9]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18895 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18896 case EVENT_SetFacesBit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18897 sub_44892E_set_faces_bit(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18898 v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18899 v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18900 v10->f[13]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18901 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18902 case EVENT_ToggleChestFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18903 Chest::ToggleFlag(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18904 v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18905 v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18906 v10->f[13]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18907 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18908 case EVENT_ToggleActorFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18909 Actor::ToggleFlag(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18910 v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18911 v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18912 v10->f[13]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18913 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18914 case EVENT_ToggleActorGroupFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18915 ToggleActorGroupFlag(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18916 v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18917 v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18918 v10->f[13]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18919 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18920 case EVENT_SetSnow:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18921 if ( !v10->f[5] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18922 pWeather->bRenderSnow = v10->f[6] != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18923 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18924 case EVENT_StatusText:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18925 v90 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18926 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18928 if ( _5C3420_pDecoration == (LevelDecoration *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18930 ptr_F8B1E8 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18931 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18933 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18935 v91 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18936 LABEL_248:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18937 ShowStatusBarString(v91, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18938 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18940 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18941 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18943 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18945 v91 = &pLevelStr[pLevelStrOffsets[v90]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18946 goto LABEL_248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18949 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18950 case EVENT_ShowMessage:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18951 v92 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18952 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18954 v93 = (&dword_721664)[8 * v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18955 byte_5B0938[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18956 ptr_F8B1E8 = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18958 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18960 strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18962 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18963 case EVENT_CastSpell:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18964 sub_448DF8_cast_spell(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18965 v10->f[5],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18966 v10->f[6],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18967 v10->f[7],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18968 v10->f[8] + ((v10->f[9] + ((v10->f[10] + (v10->f[11] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18969 v10->f[12] + ((v10->f[13] + ((v10->f[14] + (v10->f[15] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18970 v10->f[16] + ((v10->f[17] + ((v10->f[18] + (v10->f[19] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18971 v10->f[20] + ((v10->f[21] + ((v10->f[22] + (v10->f[23] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18972 v10->f[24] + ((v10->f[25] + ((v10->f[26] + (v10->f[27] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18973 v10->f[28] + ((v10->f[29] + ((v10->f[30] + (v10->f[31] << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18974 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18975 case EVENT_SetTexture:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18976 sub_44861E_set_texture(v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8), &v10->f[9]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18977 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18978 case EVENT_SetSprite:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18979 SetDecorationSprite(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18980 v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18981 v10->f[9],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18982 &v10->f[10]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18983 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18984 case EVENT_SummonMonsters:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18985 sub_448CF4_spawn_monsters(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18986 v10->f[5],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18987 v10->f[6],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18988 v10->f[7],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18989 v10->f[8] + ((v10->f[9] + ((v10->f[10] + (v10->f[11] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18990 v10->f[12] + ((v10->f[13] + ((v10->f[14] + (v10->f[15] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18991 v10->f[16] + ((v10->f[17] + ((v10->f[18] + (v10->f[19] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18992 v10->f[20] + ((v10->f[21] + ((v10->f[22] + (v10->f[23] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18993 v10->f[24] + ((v10->f[25] + ((v10->f[26] + (v10->f[27] << 8)) << 8)) << 8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18994 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18995 case EVENT_MouseOver:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18996 case EVENT_LocationName:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18997 --v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18998 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18999 case EVENT_ChangeDoorState:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19000 sub_449A49_door_switch_animation(v10->f[5], v10->f[6]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19001 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19002 case EVENT_OpenChest:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19003 if ( !Chest::Open(v10->f[5]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19004 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19005 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19006 case EVENT_MoveToMap:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19007 v94 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19008 v135 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19009 v132 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19010 v126 = v10->f[13] + ((v10->f[14] + ((v10->f[15] + (v10->f[16] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19011 v129 = v10->f[17] + ((v10->f[18] + ((v10->f[19] + (v10->f[20] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19012 v95 = v10->f[21] + ((v10->f[22] + ((v10->f[23] + (v10->f[24] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19013 v96 = v10->f[25];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19014 v97 = v96 + ((v10->f[26] + ((v10->f[27] + (v10->f[28] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19015 v134 = v96 + ((v10->f[26] + ((v10->f[27] + (v10->f[28] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19016 if ( v10->f[29] || v10->f[30] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19018 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19019 pRenderer->_49FD3A(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19020 sub_444839_move_map(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19021 (unsigned __int8)pSomeEVT[v9 + 29],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19022 (unsigned __int8)pSomeEVT[v9 + 30],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19023 v135,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19024 v132,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19025 v126,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19026 v129,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19027 v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19028 v134,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19029 &pSomeEVT[v9 + 31]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19030 dword_5C3418 = v131;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19031 dword_5C341C = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19032 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19034 _5B65AC_npcdata_fame_or_other = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19035 _5B65A8_npcdata_uflags_or_other = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19036 _5B65B0_npcdata_rep_or_other = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19037 if ( v129 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19039 v98 = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19041 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19043 v98 = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19044 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19046 v99 = &v10->f[31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19047 _5B65B8_npcdata_hiword_house_or_other = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19048 dword_5B65BC = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19049 v100 = v94 | v132 | v126 | v95 | v97 | v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19050 dword_5B65C0 = v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19051 if ( *v99 == 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19053 if ( v100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19055 pParty->vPosition.x = v135;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19056 pParty->vPosition.z = v132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19057 pParty->vPosition.y = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19058 pParty->uFallStartY = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19059 if ( _5B65B4_npcdata_loword_house_or_other != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19060 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19061 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19062 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19063 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19064 v111 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19065 v110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19066 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19067 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19068 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19069 pParty->sRotationX = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19070 pParty->uFallSpeed = v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19071 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19072 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19073 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19074 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19075 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19076 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19077 v106 = 232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19078 LABEL_280:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19079 pAudioPlayer->PlaySound((SoundID)v106, v107, v108, v109, v110, v111, v116, v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19082 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19084 pGameLoadingUI_ProgressBar->uType = (_5C3420_pDecoration == 0) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19085 sub_44987B(v99, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19086 v133 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19087 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19089 if ( uGameState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19091 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19092 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19093 while ( sub_4BD8B5() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19094 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19095 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19096 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19097 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19098 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19099 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19100 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19101 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19102 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19103 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19104 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19105 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19106 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19108 goto LABEL_302;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19111 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19112 case EVENT_PlaySound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19113 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19114 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19115 v111 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19116 v110 = v10->f[13] + ((v10->f[14] + ((v10->f[15] + (v10->f[16] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19117 v109 = v10->f[9] + ((v10->f[10] + ((v10->f[11] + (v10->f[12] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19118 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19119 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19120 v106 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19121 goto LABEL_280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19122 case EVENT_GiveItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19123 item.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19124 v101 = &pSomeEVT[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19125 v102 = (unsigned __int8)v101[7]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19126 + (((unsigned __int8)v101[8] + (((unsigned __int8)v101[9] + ((unsigned __int8)v101[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19127 pItemsTable->GenerateItem((unsigned __int8)v101[5], (unsigned __int8)v101[6], &item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19128 if ( v102 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19129 item.uItemID = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19130 pParty->SetHoldingItem(&item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19131 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19132 case EVENT_SpeakInHouse:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19133 v103 = v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19134 if ( EnterHouse((enum HOUSE_TYPE)(v10->f[5] + ((v10->f[6] + ((v10->f[7] + (v10->f[8] << 8)) << 8)) << 8))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19136 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19137 pRenderer->_49FD3A(v103);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19138 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19139 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19140 v104 = 187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19141 if ( uCurrentHouse_Animation != 167 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19142 v104 = v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19143 ptr_507BC0 = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_HouseInterior, v104, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19144 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19145 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19146 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19147 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19148 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19150 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19151 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19152 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19153 case EVENT_PressAnyKey:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19154 v121 = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19155 v105 = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19156 goto LABEL_295;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19157 case EVENT_Exit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19158 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19161 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19162 v124 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19163 if ( v4 >= (signed int)uSomeEVT_NumEvents )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19164 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19165 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19171 //----- (0044861E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19172 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19174 unsigned int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19175 unsigned __int16 v3; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19176 signed int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19177 BLVFace *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19178 unsigned int *v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19179 char *v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19180 int v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19181 char *v9; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19182 ODMFace *v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19183 unsigned int *v11; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19184 unsigned __int16 v12; // [sp+Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19185 const char *Str2; // [sp+10h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19186 unsigned int v14; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19187 signed int v15; // [sp+18h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19188 int v16; // [sp+1Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19189 signed int v17; // [sp+20h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19190 signed int v18; // [sp+20h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19192 Str2 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19193 v14 = uFaceCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19194 if ( uFaceCog )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19196 v2 = pBitmaps_LOD->LoadTexture(pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19197 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19198 v12 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19199 if ( v2 != -1 ? (int)&pBitmaps_LOD->pTextures[v2] : 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19201 HIWORD(pBitmaps_LOD->pTextures[v2].palette) = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v2].palette);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19202
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19203 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19205 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19206 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19208 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19209 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19211 if ( pIndoor->pFaceExtras[v4].sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19213 v5 = &pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19214 if ( BYTE1(v5->uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19216 pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19217 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19218 v6 = (unsigned int *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19219 if ( *(_WORD *)v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19221 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19223 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19225 *(_WORD *)v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19226 v7 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19227 v7[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19230 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19232 v5->uBitmapID = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19235 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19236 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19238 while ( v17 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19240 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19242 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19244 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19245 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19247 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19248 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19250 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19251 v9 = (char *)&pOutdoor->pBModels[v16].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19252 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19253 if ( (signed int)pOutdoor->pBModels[v16].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19255 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19257 v10 = (ODMFace *)(v8 + *((_DWORD *)v9 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19258 if ( v10->sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19260 if ( BYTE1(v10->uFaceAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19262 *(_WORD *)(*((_DWORD *)v9 + 4) + v8 + 272) = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19263 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19264 v11 = (unsigned int *)(*((_DWORD *)v9 + 4) + v8 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19265 if ( *(_WORD *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19267 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19269 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19271 *(_WORD *)v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19272 *(_BYTE *)(*((_DWORD *)v9 + 4) + v8 + 29) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19275 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19277 v10->uTextureID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19280 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19281 v8 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19283 while ( v18 < *((_DWORD *)v9 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19285 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19286 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19288 while ( v15 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19291 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19295
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19296
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19298
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19299 //----- (0044882F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19300 void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19302 signed int v3; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19303 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19304 unsigned __int16 v5; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19305 unsigned int v6; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19306 int v7; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19307
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19308 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19309 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19310 v6 = uCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19311 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19313 v4 = (char *)&pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19314 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19316 if ( *((_WORD *)v4 + 9) == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19318 if ( pFileName && _strcmpi(pFileName, "0") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19320 v5 = pDecorationList->GetDecorIdByName(pFileName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19321 *((_WORD *)v4 - 1) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19322 pDecorationList->InitializeDecorationSprite((signed __int16)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19324 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19325 *v4 &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19326 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19327 *v4 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19328 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19330 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19331 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19333 while ( v3 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19336
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19337
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19338 //----- (004488B6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19339 unsigned __int16 DecorationList::GetDecorIdByName(const char *pName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19341 DecorationList *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19342 signed int uID; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19343 signed int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19344 unsigned __int16 result; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19345
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19346 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19347 if ( pName && (uID = 1, (signed int)this->uNumDecorations > 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19349 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19350 while ( _strcmpi(pName, v2->pDecorations[v4].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19352 ++uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19353 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19354 if ( uID >= (signed int)v2->uNumDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19355 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19357 result = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19359 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19361 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19362 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19364 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19367
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19368 //----- (0044892E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19369 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19371 signed int v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19372 signed int v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19373 char *v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19374 int v6; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19375 char *v7; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19376 signed int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19377 ODMFace *v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19378 int v10; // [sp+0h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19379 signed int v11; // [sp+4h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19380 int v12; // [sp+8h] [bp-4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19381
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19382 v10 = sCogNumber;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19383 if ( sCogNumber )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19385 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19386 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19388 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19390 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19391 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19393 if ( pIndoor->pFaceExtras[v4].sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19395 v5 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19396 if ( on )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19397 *(_DWORD *)v5 |= bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19398 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19399 *(_DWORD *)v5 &= ~bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19401 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19402 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19404 while ( v3 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19406 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19408 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19410 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19411 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19413 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19414 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19416 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19417 v7 = (char *)&pOutdoor->pBModels[v12].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19418 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19419 if ( (signed int)pOutdoor->pBModels[v12].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19421 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19423 v9 = (ODMFace *)(v6 + *((_DWORD *)v7 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19424 if ( v9->sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19426 if ( on )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19427 v9->uFaceAttributes |= bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19428 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19429 v9->uFaceAttributes &= ~bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19431 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19432 v6 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19434 while ( v8 < *((_DWORD *)v7 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19436 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19437 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19439 while ( v11 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19442 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19445
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19446
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19447 //----- (00448A17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19448 void Chest::ToggleFlag(unsigned int uChestID, unsigned __int16 uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19450 unsigned __int16 *pFlags; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19451
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19452 if ( (uChestID & 0x80000000u) == 0 && (signed int)uChestID <= 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19454 pFlags = &pChests[uChestID].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19455 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19456 *pFlags |= uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19457 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19458 *pFlags &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19461
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19462 //----- (00448A40) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19463 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19465 unsigned __int16 *pState; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19466
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19467 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19469 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19471 pActors[uActorID].uAttributes |= uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19473 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19475 if ( uFlag == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19477 pState = &pActors[uActorID].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19478 if ( *pState == Disabled )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19479 *pState = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19481 pActors[uActorID].uAttributes &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19485
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19486 //----- (00448A98) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19487 void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19489 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19490 unsigned int v4; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19491 signed int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19492 char *v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19493 size_t v7; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19494 char *v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19495 unsigned __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19496
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19497 v4 = uGroupID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19498 v5 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19499 v3 = uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19500 if ( uGroupID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19502 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19504 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19506 v6 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19507 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19509 if ( *((_DWORD *)v6 + 168) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19511 *(_DWORD *)v6 |= v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19512 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19514 *((_WORD *)v6 + 70) = Disabled;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19515 ((Actor *)(v6 - 36))->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19518 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19519 v6 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19521 while ( v5 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19524 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19526 v7 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19527 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19529 v8 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19530 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19532 if ( *((_DWORD *)v8 + 133) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19534 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19536 v9 = *(_WORD *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19537 if ( *(_WORD *)v8 != Dead )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19539 if ( v9 != 4 && v9 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19540 *(_WORD *)v8 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19543 *((_DWORD *)v8 - 35) &= ~v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19545 v8 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19546 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19548 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19553
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19554
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19555 //----- (00448B45) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19556 void __thiscall GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19558 if ( bForceHide || GameUI_StatusBar_TimedStringTimeLeft && GetTickCount() >= GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19559 GameUI_StatusBar_TimedStringTimeLeft = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19562 //----- (00448B67) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19563 void __thiscall OnTimer(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19565 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19566 unsigned int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19567 unsigned int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19568 char *v4; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19569 __int16 v5; // ax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19570 int v6; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19571 unsigned int v7; // ebp@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19572 int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19573 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19574 unsigned __int64 v10; // qax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19575 int v11; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19576 int v12; // [sp+Ch] [bp-10h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19577 unsigned int v13; // [sp+10h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19579 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19580 if ( !pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19582 if ( a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19583 dword_5773C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19584 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19585 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19586 v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19587 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19589 _5773B8_event_timer = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19590 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19591 if ( dword_5B65C8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19593 v4 = (char *)&array_5B5928[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19594 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19596 v5 = *(short *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19597 if ( *(short *)v4 != (short)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19598 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19599 v7 = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19600 if ( v7 <= v3 && (v7 < v3 || *((int *)v4 - 3) <= v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19602 if ( *((short *)v4 + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19604 v8 = 29030400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19606 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19608 if ( *((short *)v4 + 3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19610 v8 = 2419200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19612 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19614 v9 = -(*((short *)v4 + 4) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19615 v8 = (v9 & 0x7E900) + 86400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19618 v10 = __PAIR__(v7, *((int *)v4 - 3)) + (signed __int64)((double)((signed __int64)v8 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19619 *((int *)v4 - 3) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19620 *((int *)v4 - 2) = HIDWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19621 if ( HIDWORD(v10) <= v3 && (HIDWORD(v10) < v3 || *((int *)v4 - 3) < v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19623 *((int *)v4 - 3) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19624 *((int *)v4 - 2) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19626 v11 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19627 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19628 EventProcessor(v11, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19629 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19630 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19631 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19632 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19634 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19635 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19636 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19637 if ( v12 >= dword_5B65C8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19638 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19639 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19641 if ( v13 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19643 *(short *)v4 = v5 - v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19644 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19646 v6 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19647 *(short *)v4 = *((short *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19648 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19649 EventProcessor(v6, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19650 dword_597F18 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19651 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19656
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19657 //----- (00481D77) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19658 void _outdoor_project(RenderVertexSoft *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19660 double v1; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19661 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19662
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19663 v1 = 1.0 / (v->vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19664 v->flt_20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19665 v2 = v1 * (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19666 v->vWorldViewProjX = (double)pViewport->uScreenCenterX - v2 * v->vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19667 v->vWorldViewProjY = (double)pViewport->uScreenCenterY - v2 * v->vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19669
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19670
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19671 //----- (00448CF4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19672 void __fastcall sub_448CF4_spawn_monsters(__int16 typeindex, __int16 level, int count, int x, int y, int z, int group, unsigned int uUniqueName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19674 __int16 v8; // di@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19675 __int16 v9; // si@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19676 unsigned int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19677 size_t v11; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19678 signed int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19679 char *v13;//Actor_uYawAngle_cr *v13; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19680 AIDirection a3; // [sp+Ch] [bp-50h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19681 AIDirection v15; // [sp+28h] [bp-34h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19682 //SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19683
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19684 v8 = typeindex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19685 v9 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19686
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19687 SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19688 //SpawnPointMM7::SpawnPointMM7(&v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19689
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19690 v16.vPosition.x = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19691 v16.vPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19692 v16.vPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19693 v16.uGroup = group;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19694 v16.uRadius = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19695 v16.uKind = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19696 v16.uIndex = v8 + 2 * v9 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19697 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19698 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19700 v11 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19701 SpawnEncounter((MapInfo *)&pMapStats + v10, &v16, 0, count, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19702 memcpy(&v15, Actor::GetDirectionInfo(8 * v11 | AI_OBJECT_ACTOR, 4u, &a3, 1), sizeof(v15));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19703 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19704 if ( (signed int)v11 < (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19706 v13 = (char *)&pActors[v11].uYawAngle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19707 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19709 ((Actor *)((char *)v13 - 154))->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19710 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19711 *(short *)v13/*->uYawAngle*/ = LOWORD(v15.uYawAngle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19712 *(int *)(v13+666)/*->dword_000334_unique_name*/ = uUniqueName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19713 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19715 while ( v12 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19719
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19720
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19721 //----- (00448DF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19722 void __fastcall sub_448DF8_cast_spell(int spellnum, int rank, int level, int fromx, int fromy, int fromz, int tox, int toy, int toz)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19724 int v9; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19725 double v10; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19726 double v11; // st6@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19727 double v12; // st5@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19728 double v13; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19729 int v14; // ST44_4@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19730 signed int v15; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19731 signed int v16; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19732 char *v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19733 unsigned __int16 v18; // ax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19734 char *v19; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19735 int v20; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19736 signed int v21; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19737 char *v22; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19738 unsigned __int16 v23; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19739 int i; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19740 signed int v25; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19741 char *v26; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19742 unsigned __int16 v27; // ax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19743 int j; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19744 signed int v29; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19745 char *v30; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19746 unsigned __int16 v31; // ax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19747 char *v32; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19748 unsigned __int16 v33; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19749 int v34; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19750 int v35; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19751 unsigned __int64 v36; // qax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19752 SpellBuff *v37; // ecx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19753 int v38; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19754 signed __int64 v39; // qax@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19755 int v40; // ebx@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19756 int v41; // ebx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19757 int v42; // esi@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19758 int v43; // ebx@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19759 int v44; // eax@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19760 unsigned __int16 v45; // si@137
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19761 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19762 int v47; // [sp-4h] [bp-B8h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19763 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19764 int v49; // [sp+0h] [bp-B4h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19765 int v50; // [sp+0h] [bp-B4h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19766 int v51; // [sp+4h] [bp-B0h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19767 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19768 float v53; // [sp+14h] [bp-A0h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19769 float v54; // [sp+18h] [bp-9Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19770 int v55; // [sp+28h] [bp-8Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19771 unsigned int yaw; // [sp+30h] [bp-84h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19772 int pitch; // [sp+34h] [bp-80h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19773 //LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19774 int v59; // [sp+A8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19775 int v60; // [sp+ACh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19776 int spellnum_; // [sp+B0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19777 signed int levela; // [sp+BCh] [bp+8h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19778 int a6_4; // [sp+C8h] [bp+14h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19779 float a7a; // [sp+CCh] [bp+18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19780 signed int a7b; // [sp+CCh] [bp+18h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19781 int a7c; // [sp+CCh] [bp+18h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19782 int a7d; // [sp+CCh] [bp+18h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19783 float a8a; // [sp+D0h] [bp+1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19784 int a8b; // [sp+D0h] [bp+1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19785 int a8c; // [sp+D0h] [bp+1Ch]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19786 float toza; // [sp+D4h] [bp+20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19788 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19789 v59 = rank + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19790 spellnum_ = spellnum;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19791 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19792 if ( tox || toy || toz )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19794 v10 = (double)tox - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19795 v53 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19796 v11 = (double)toy - (double)fromy;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19797 v54 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19798 v12 = (double)toz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19799 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19800 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19802 v10 = (double)pParty->vPosition.x - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19803 v53 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19804 v11 = (double)pParty->vPosition.z - (double)fromy;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19805 v54 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19806 v12 = (double)(pParty->vPosition.y + pParty->sEyelevel);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19808 a7a = v12 - (double)fromz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19809 toza = v11 * v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19810 a8a = v10 * v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19811 v13 = sqrt(a7a * a7a + a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19812 if ( v13 <= 1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19814 LOBYTE(v55) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19815 yaw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19816 pitch = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19818 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19820 v55 = (signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19821 v14 = (signed __int64)sqrt(a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19822 yaw = stru_5C6E00->Atan2((signed __int64)v53, (signed __int64)v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19823 pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19825 v15 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19826 if ( v59 <= 0 || v59 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19827 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19828 a7b = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19829
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19830 LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19831 //LayingItem::LayingItem(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19832
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19833 a1.uItemType = stru_4E3ACC[spellnum_].uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19834 if ( spellnum_ > 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19836 if ( spellnum_ == 69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19837 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19838 if ( spellnum_ != 83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19839 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19840 v40 = v15 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19841 if ( v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19843 v41 = v40 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19844 if ( !v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19846 v42 = 14400 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19847 v43 = 4 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19848 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19850 if ( v41 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19852 v42 = 18000 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19853 v43 = 5 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19854 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19857 v42 = 10800 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19858 v43 = 3 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19859 LABEL_114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19860 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19861 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19862 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19863 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19864 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19865 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19866 v48 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19867 v46 = a7b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19868 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19869 v37 = &pParty->pPartyBuffs[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19870 LABEL_115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19871 v36 = pParty->uTimePlayed + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19872 LABEL_116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19873 v37->Apply(v36, v46, v48, v50, v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19874 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19876 if ( spellnum_ != 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19878 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19880 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19881 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19882 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19883 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19884 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19885 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19886 case 39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19887 case 41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19888 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19889 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19890 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19891 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19892 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19893 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19894 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19895 v17 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19896 while ( (short)a1.uItemType != *(short *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19898 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19899 v17 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19900 if ( v16 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19901 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19903 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19904 v18 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19905 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19906 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19907 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19909 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19910 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19911 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19912 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19913 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19914 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19915 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19916 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19917 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19918 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19919 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19920 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19922 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19923 if ( v60 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19925 a8b = a7c / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19926 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19927 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19928 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19929 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19930 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19931 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19933 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19934 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19936 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19938 v22 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19939 while ( (short)a1.uItemType != *(short *)v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19941 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19942 v22 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19943 if ( v21 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19944 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19946 v23 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19948 a1.uObjectDescID = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19949 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19950 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19951 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19952 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19953 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19954 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19955 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19956 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19957 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19958 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19960 a1.uFacing = i + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19961 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19962 (signed __int16)(i + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19963 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19964 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19965 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19967 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19969 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19970 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19971 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19972 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19973 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19974 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19975 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19976 v19 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19977 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19979 if ( (short)a1.uItemType == *(short *)v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19980 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19981 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19982 v19 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19984 while ( v16 < (signed int)pObjectList->uNumObjects );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19985 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19986 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19987 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19988 a1.uObjectDescID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19989 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19990 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19991 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19992 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19993 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19994 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19995 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19996 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19997 a1.field_5C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19998 a1.uFacing = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19999 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20000 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20001 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20002 v47 = pitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20003 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20004 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20005 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20007 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20008 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20009 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20010 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20011 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20012 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20013 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20014 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20015 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20016 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20017 v60 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20018 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20020 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20021 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20022 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20023 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20024 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20025 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20026 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20027 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20028 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20029 v26 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20030 while ( (short)a1.uItemType != *(short *)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20032 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20033 v26 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20034 if ( v25 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20036 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20037 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20038 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20041 v27 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20042 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20043 a1.uObjectDescID = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20044 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20045 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20046 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20047 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20048 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20049 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20050 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20051 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20052 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20053 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20055 a1.uFacing = j + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20056 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20057 (signed __int16)(j + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20058 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20059 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20060 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20062 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20063 case 43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20064 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20065 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20066 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20067 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20068 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20069 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20070 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20071 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20072 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20073 v30 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20074 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20075 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20076 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20078 if ( v15 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20080 v9 = 60 * (level + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20082 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20084 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20086 v9 = 180 * (level + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20088 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20090 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20091 v9 = 240 * (level + 15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20095 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20096 v32 = (char *)&pParty->pPlayers[0].pConditions[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20097 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20099 if ( *(_QWORD *)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20100 levela = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20101 v32 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20103 while ( (signed int)v32 < (signed int)&pParty->pHirelings[0].uFlags );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20104 if ( !levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20105 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20106 pParty->pPartyBuffs[8].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20107 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20108 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20109 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20110 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20111 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20112 v33 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20113 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20114 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20115 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20116 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20117 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20118 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20119 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20120 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20121 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20123 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20124 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20125 v9 = 300 * (level + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20126 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20127 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20128 v9 = 900 * (level + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20129 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20130 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20131 v9 = 3600 * (level + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20132 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20134 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20136 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20137 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20138 level = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20139 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20140 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20141 v35 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20142 level = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20143 v60 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20144 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20145 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20146 v34 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20147 level = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20148 v60 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20149 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20151 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20152 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20153 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20154 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20155 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20156 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20157 v48 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20158 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20159 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20160 v37 = &pParty->pPartyBuffs[level];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20161 goto LABEL_116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20162 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20163 if ( v15 == 2 || v15 == 3 || v15 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20164 v38 = 60 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20165 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20166 v38 = 600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20167 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20168 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20169 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20170 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20171 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20172 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20173 v48 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20174 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20175 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20176 v37 = &pParty->pPartyBuffs[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20177 goto LABEL_115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20178 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20179 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20180 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20181 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20182 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20183 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20184 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20186 while ( (short)a1.uItemType != *(short *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20188 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20189 v30 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20190 if ( v29 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20192 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20193 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20194 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20197 v31 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20198 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20199 a1.uObjectDescID = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20200 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20201 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20202 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20203 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20204 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20205 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20206 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20207 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20208 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20209 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20210 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20211 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20212 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20213 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20214 a1.Create(v20, v47, v49, v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20215 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20217 LABEL_117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20218 v44 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20219 a6_4 = 3600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20220 if ( v15 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20222 LABEL_124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20223 v60 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20224 goto LABEL_125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20226 if ( v15 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20228 v44 = 2 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20229 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20231 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20233 v44 = 3 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20234 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20236 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20238 v44 = 4 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20239 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20241 LABEL_125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20242 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20243 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20244 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20245 level = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20246 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20247 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20248 level = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20249 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20250 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20251 level = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20252 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20253 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20254 level = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20255 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20256 case 58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20257 level = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20258 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20259 case 69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20260 level = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20261 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20263 v45 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20264 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20265 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20266 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20267 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20268 pParty->pPartyBuffs[level].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20269 pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20270 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20271 v60,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20272 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20273 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20274 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20275 LABEL_138:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20276 if ( levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20277 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20278 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum_], 0, 0, fromx, fromy, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20280 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20282 //----- (0044987B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20283 char *__fastcall sub_44987B(const char *pMapName, unsigned int uStartingPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20285 const char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20286 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20287 char *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20289 v2 = pMapName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20290 v3 = uStartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20291 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20292 pGameLoadingUI_ProgressBar->_443484(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20293 if ( _strcmpi(pCurrentMapName, v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20294 SaveGame(1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20295 uGameState = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20296 result = strcpy(pCurrentMapName, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20297 uLevel_StartingPointType = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20298 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20300 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20301
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20302 //----- (004498D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20303 void __thiscall TeleportToStartingPoint(unsigned int uPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20305 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20306 int v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20307 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20308 unsigned __int16 v4; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20309 signed int v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20310 LevelDecoration *v6; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20311 signed int v7; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20312 int v8; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20313 int v9; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20314 const char *v10; // [sp-4h] [bp-84h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20315 char pName[128]; // [sp+8h] [bp-78h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20316
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20317 if ( uPointType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20319 v1 = uPointType - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20320 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20322 v2 = v1 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20323 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20325 v3 = v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20326 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20328 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20329 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20330 v10 = "West Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20332 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20334 v10 = "East Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20337 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20339 v10 = "South Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20342 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20344 v10 = "North Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20347 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20349 v10 = "Party Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20351 strcpy(pName, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20352 v4 = pDecorationList->GetDecorIdByName(pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20353 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20355 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20356 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20358 v6 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20359 while ( v6->uDecorationDescID != (signed __int16)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20361 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20362 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20363 if ( v5 >= (signed int)uNumLevelDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20364 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20366 v7 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20367 pParty->vPosition.x = pLevelDecorations[v7].vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20368 pParty->vPosition.z = pLevelDecorations[v7].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20369 pParty->vPosition.y = pLevelDecorations[v7].vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20370 pParty->uFallStartY = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20371 v8 = (signed int)(stru_5C6E00->uIntegerHalfPi * pLevelDecorations[v7].field_1A) / 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20372 v9 = pLevelDecorations[v7].field_10_y_rot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20373 pParty->sRotationY = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20374 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20375 pParty->sRotationY = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20376 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20377 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20379 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20380 if ( dword_5B65C0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20382 if ( _5B65A8_npcdata_uflags_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20383 pParty->vPosition.x = _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20384 if ( _5B65AC_npcdata_fame_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20385 pParty->vPosition.z = _5B65AC_npcdata_fame_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20386 if ( _5B65B0_npcdata_rep_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20388 pParty->vPosition.y = _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20389 pParty->uFallStartY = _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20391 if ( _5B65B4_npcdata_loword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20392 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20393 if ( _5B65B8_npcdata_hiword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20394 pParty->sRotationX = _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20395 if ( dword_5B65BC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20396 pParty->uFallSpeed = dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20398 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20399 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20400 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20401 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20402 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20403 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20404 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20407 // 5B65A8: using guessed type int _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20408 // 5B65AC: using guessed type int _5B65AC_npcdata_fame_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20409 // 5B65B0: using guessed type int _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20410 // 5B65B4: using guessed type int _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20411 // 5B65B8: using guessed type int _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20412 // 5B65BC: using guessed type int dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20413 // 5B65C0: using guessed type int dword_5B65C0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20414
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20415 //----- (00449A49) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20416 __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20418 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20419 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20420 signed int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20421 int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20422 BLVDoor *v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20423 unsigned int v7; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20424 signed int v8; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20425 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20426 char Args; // [sp+Ch] [bp-78h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20427
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20428 LOWORD(v2) = LOWORD(pIndoor->pDoors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20429 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20430 if ( !pIndoor->pDoors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20431 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20432 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20433 v5 = (int)&pIndoor->pDoors->uDoorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20434 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20436 if ( *(int *)v5 == uDoorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20437 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20438 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20439 v5 += 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20441 while ( v4 < 200 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20442 if ( v4 >= 200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20444 sprintfex(&Args, "Unable to find Door ID: %i!", uDoorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20445 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20447 v6 = &pIndoor->pDoors[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20448 if ( v3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20450 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20451 if ( (short)v2 == 3 || (short)v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20452 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20453 if ( (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20454 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20456 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20458 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20460 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20461 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20462 if ( (short)v2 && (short)v2 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20463 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20464 v6->uState = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20465 if ( (short)v2 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20467 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20468 v6->uTimeSinceTriggered = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20469 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20471 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20472 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20473 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20475 v8 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20476 v9 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20477 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20478 v2 = (v6->uMoveLength << 7) / v8 - ((signed int)(v7 * v9) / 128 << 7) / v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20479 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20481 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20483 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20485 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20486 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20488 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20489 if ( (short)v2 != 2 && (short)v2 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20491 v6->uState = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20492 if ( !(short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20493 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20494 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20495 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20496 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20498 v8 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20499 v9 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20500 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20502 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20503 v6->uTimeSinceTriggered = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20505 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20507
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20508 //----- (00449B57) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20509 unsigned int __fastcall _449B57_test_bit(unsigned __int8 *a1, __int16 a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20511 return a1[(a2 - 1) >> 3] & (0x80u >> (a2 - 1) % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20513
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20514 //----- (00449B7E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20515 char *__fastcall _449B7E_toggle_bit(char *pArray, __int16 a2, unsigned __int16 bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20517 signed int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20518 char *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20519 unsigned int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20520
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20521 v3 = a2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20522 result = &pArray[(signed __int16)(v3 >> 3)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20523 v5 = 0x80u >> v3 % 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20524 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20525 *result |= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20526 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20527 *result &= ~(char)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20528 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20529 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20530
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20531
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20532 //----- (0044A56A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20533 void __cdecl sub_44A56A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20535 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20536 NPCData *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20537
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20538 pParty->field_70A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20539 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20540 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20542 v1 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20543 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20545 if ( v1->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v1->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20547 if ( !pParty->pHirelings[1].pName || strcmp(v1->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20548 ++pParty->field_70A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20550 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20551 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20553 while ( v0 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20556
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20557
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20558 //----- (0044C175) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20559 void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20561 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20562 int i; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20563
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20564 v2 = uNumSeconds;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20565 strcpy(GameUI_StatusBar_TimedString, pString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20566 GameUI_StatusBar_TimedStringTimeLeft = 1000 * v2 + GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20567 for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20568 i > 450;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20569 i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20570 byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20572
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20573 //----- (0044C1D0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20574 void __cdecl ShowNothingHereStatus()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20576 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20577 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20579
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20580
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20581 //----- (0044C28B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20582 signed int __cdecl const_2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20583 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20584 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20586
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20587 //----- (0044C28F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20588 bool __cdecl sub_44C28F_open_nwc_dungeon()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20590 bool result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20591
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20592 result = _strcmpi("nwc.blv", pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20593 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20595 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20596 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20597 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20598 _5B65B4_npcdata_loword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20599 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20600 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20601 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20602 pGameLoadingUI_ProgressBar->uType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20603 sub_44987B("nwc.blv", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20604 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20605 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20607 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20609 // 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
20610 // 5B65A8: using guessed type int _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20611 // 5B65AC: using guessed type int _5B65AC_npcdata_fame_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20612 // 5B65B0: using guessed type int _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20613 // 5B65B4: using guessed type int _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20614 // 5B65B8: using guessed type int _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20615 // 5B65BC: using guessed type int dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20616 // 5B65C0: using guessed type int dword_5B65C0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20618 //----- (0044C2F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20619 int LevelDecoration::IsInteractive()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20621 signed int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20623 v1 = this->uDecorationDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20624 if ( v1 > 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20626 if ( v1 == 184 || v1 == 187 || v1 == 190 || v1 > 205 && v1 <= 221 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20627 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20629 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20631 if ( v1 == 34 || v1 >= 4 && (v1 <= 6 || v1 == 11 || v1 > 12 && (v1 <= 14 || v1 == 24)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20632 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20634 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20636
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20637 //----- (0044C362) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20638 void Vec3_int_::Normalize_float()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20640 Vec3_int_ *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20641 double v2; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20642 float v3; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20643 double v4; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20644 float v5; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20645 double v6; // st4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20646 float v7; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20647 float v8; // ST24_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20648 float v9; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20649 double v10; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20650 float v11; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20651 double v12; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20652 float v13; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20653 double v14; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20654
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20655 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20656 v2 = (double)this->x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20657 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20658 v4 = (double)this->y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20659 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20660 v6 = (double)this->z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20661 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20662 v8 = 1.0 / sqrt(v6 * v6 + v4 * v4 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20663 v9 = v8 * v3 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20664 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20665 v1->x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20666 v11 = v8 * v5 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20667 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20668 v1->y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20669 v13 = v8 * v7 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20670 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20671 v1->z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20674 //----- (0044C448) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20675 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20677 GUIFont *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20678 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20679 const char **v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20680 unsigned int v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20681 unsigned __int16 **v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20682 GUIFont *v7; // [sp+4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20683 int v8; // [sp+8h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20684 unsigned __int16 **v9; // [sp+Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20685
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20686 result = (GUIFont *)pIcons_LOD->LoadRaw(pFontFile, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20687 v3 = pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20688 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20689 v7 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20690 if ( pFontPalette )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20692 v4 = &pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20693 v9 = result->pFontPalettes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20694 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20696 v5 = pIcons_LOD->LoadTexture(v3, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20697 if ( v5 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20699 sprintfex(pTmpBuf, "Unable to open %s", v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20700 Abortf(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20702 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20703 v6 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20704 v3 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20705 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20706 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20707 *v6 = (v5 != -1 ? pIcons_LOD->pTextures[v5].pPalette16 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20709 while ( v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20710 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20712 result->field_8 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20713 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20716
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20717
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20718
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20719 //----- (0044C768) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20720 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20722 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20723 GUIFont *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20724 unsigned int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20725 int v9; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20726 unsigned __int8 v10; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20727 int v11; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20728 GUICharMetric *v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20729 int v13; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20730 int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20731 int v15; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20732 unsigned int v16; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20733 unsigned int v17; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20734 unsigned int v18; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20735 int v19; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20736 unsigned __int8 v20; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20737 char v21; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20738 unsigned __int8 v22; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20739 int v23; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20740 unsigned __int8 v24; // dl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20741 int v25; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20742 int v26; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20743 std::string v27; // [sp-18h] [bp-40h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20744 const char *v28; // [sp-8h] [bp-30h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20745 int v29; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20746 const char *v30; // [sp+Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20747 char Str[3]; // [sp+10h] [bp-18h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20748 char v32; // [sp+13h] [bp-15h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20749 size_t v33; // [sp+14h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20750 unsigned int v34; // [sp+18h] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20751 GUIFont *v35; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20752 int v36; // [sp+20h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20753 int v37; // [sp+24h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20754
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20755 v5 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20756 v6 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20757 v30 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20758 v35 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20759 if ( !pInString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20761 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20762 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20764 v33 = strlen(pInString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20765 strcpy(pTmpBuf3, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20766 v8 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20767 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20768 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20769 v34 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20770 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20771 if ( (signed int)v33 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20773 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20775 v10 = pTmpBuf3[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20776 if ((v10 < v6->cFirstChar || v10 > v6->cLastChar)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20777 && v10 != '\f' && v10 != '\r' && v10 != '\t' && v10 != '\n' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20778 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20779 v11 = v10 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20780 v12 = &v6->pMetrics[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20781 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20783 strncpy(Str, &pTmpBuf3[v9 + 1], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20784 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20785 v26 = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20786 v8 = uX + v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20787 v25 = v9 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20788 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20789 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20791 v13 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20792 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20793 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20794 v14 = v13 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20795 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20797 v25 = v9 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20798 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20799 v37 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20800 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20802 v15 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20803 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20805 if ( v15 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20807 v16 = v12->uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20808 v17 = v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20809 v18 = v12->uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20810 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20812 if ( v37 > v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20813 v8 += v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20814 v8 += v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20815 if ( v37 < (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20816 v8 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20817 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20819 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20821 v19 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20822 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20823 v22 = __OFSUB__(v36, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20824 v20 = v36 == v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20825 v21 = v36 - v37 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20826 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20827 pTmpBuf3[v36] = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20828 v23 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20829 if ( (unsigned __int8)(v21 ^ v22) | v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20831 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20833 v24 = pTmpBuf3[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20834 if ( v24 >= v6->cFirstChar && v24 <= v6->cLastChar || v24 == 12 || v24 == 13 || v24 == 9 || v24 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20836 if ( v23 > v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20837 v8 += v6->pMetrics[v24].uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20838 v8 += *((int *)&v6->cFirstChar + 3 * v24 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20839 if ( v23 < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20840 v8 += v6->pMetrics[v24].uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20842 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20844 while ( v23 <= v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20847 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20849 v8 += v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20850 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20852 if ( !a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20853 return (char *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20854 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20855 v9 = v37++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20856 if ( v37 >= (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20857 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20859 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20860 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20861 v36 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20862 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20864 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20866
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20868
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20869
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20870
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20871
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20873
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20874
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20875
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20876
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20877 //----- (00401000) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20878 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20880 void *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20881 int v5; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20882
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20883 if ( numObjs - 1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20885 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20886 v5 = numObjs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20887 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20889 constructor((int)v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20890 v4 = (char *)v4 + objSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20891 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20893 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20896
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20897
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20898 //----- (004014E6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20899 int __cdecl ODM_4014E6_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20901 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20902 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20903 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20904 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20905 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20906 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20907 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20908 unsigned int v7; // ST20_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20909 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20910 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20911 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20912 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20913 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20914 int result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20915 int v14; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20916 int v15; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20917 int v16; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20918 unsigned int *v17; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20919 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20920 int i; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20921 char *v20; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20922 int v21; // [sp+Ch] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20923 int v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20924 int v23; // [sp+14h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20925 int v24; // [sp+14h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20926 signed int v25; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20927 signed int v26; // [sp+18h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20928 int v27; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20929
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20930 pParty->uFlags &= 0xFFFFFFCFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20931 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20932 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20933 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20935 v0 = (int)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20936 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20938 *(char *)(v0 + 1) &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20939 if ( ! ((Actor *)(v0 - offsetof(Actor, uAttributes)))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20940 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20941 v22 = abs(pParty->vPosition.y - *(short *)(v0 + 110));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20942 v21 = abs(pParty->vPosition.z - *(short *)(v0 + 108));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20943 v1 = abs(pParty->vPosition.x - *(short *)(v0 + 106));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20944 v2 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20945 v3 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20946 if ( v1 < v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20948 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20949 v1 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20950 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20952 if ( v1 < v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20954 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20955 v1 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20956 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20957 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20958 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20960 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20961 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20962 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20964 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20965 v8 = *(short *)(v0 + 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20966 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20967 v23 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20968 if ( v23 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20970 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20971 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20973 if ( v9 < 5632 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20975 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20976 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20977 if ( v10 & 0x80000 || ((Actor *)(v0 - offsetof(Actor, uAttributes)))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20979 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20980 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20981 if ( v11 && (double)v23 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20982 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20983 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20984 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20986 *(char *)(v0 + 1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20987 v12 = v27++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20988 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20989 ai_array_4F7DB0_actor_ids[v12] = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20991 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20993 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20994 *(char *)(v0 + 1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20996 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20997 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20999 while ( v25 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21001 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21002 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21004 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21005 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21006 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21007 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21009 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21011 v24 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21012 if ( v15 >= result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21013 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21014 v16 = ai_array_4F75E0[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21015 if ( v16 > ai_array_4F75E0[v15] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21017 v17 = &ai_array_4F7DB0_actor_ids[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21018 v18 = ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21019 ai_array_4F7DB0_actor_ids[v14] = *v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21020 *v17 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21021 v15 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21022 ai_array_4F75E0[v14] = ai_array_4F75E0[v24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21023 ai_array_4F75E0[v24] = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21025 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21026 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21028 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21029 v15 = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21030 v26 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21032 while ( v15 - 1 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21034 ai_arrays_size = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21035 if ( result > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21037 result = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21038 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21040 for ( i = 0; i < result; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21042 v20 = (char *)&pActors[ai_array_4F7DB0_actor_ids[i]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21043 v20[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21045 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21047 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21048
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21049 //----- (004016FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21050 int __cdecl BLV_4016FA_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21052 char *v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21053 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21054 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21055 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21056 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21057 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21058 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21059 unsigned int v7; // ST24_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21060 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21061 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21062 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21063 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21064 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21065 int v13; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21066 int v14; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21067 int v15; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21068 unsigned int *v16; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21069 unsigned int v17; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21070 int v18; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21071 signed int v19; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21072 Actor *v20; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21073 bool v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21074 int v22; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21075 signed int v23; // ebx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21076 char *v24; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21077 signed int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21078 int v26; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21079 int v27; // ebx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21080 int j; // edi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21081 unsigned int v29; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21082 int v30; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21083 int v31; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21084 int v32; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21085 signed int v33; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21086 __int64 v34; // qax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21087 char *v35; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21088 int v37; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21089 int v38; // [sp+10h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21090 int v39; // [sp+14h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21091 int v40; // [sp+18h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21092 int v41; // [sp+18h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21093 int i; // [sp+18h] [bp-Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21094 signed int v43; // [sp+1Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21095 signed int v44; // [sp+1Ch] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21096 int v45; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21097
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21098 pParty->uFlags &= 0xFFFFFFCFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21099 v37 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21100 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21101 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21102 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21104 v0 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21105 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21107 v0[1] &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21108 if ( ! ((Actor *)(v0 - 36))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21109 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21110 v39 = abs(pParty->vPosition.y - *((short *)v0 + 55));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21111 v38 = abs(pParty->vPosition.z - *((short *)v0 + 54));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21112 v1 = abs(pParty->vPosition.x - *((short *)v0 + 53));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21113 v2 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21114 v3 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21115 if ( v1 < v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21117 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21118 v1 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21119 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21121 if ( v1 < v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21123 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21124 v1 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21125 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21127 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21129 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21130 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21131 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21133 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21134 v8 = *((short *)v0 + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21135 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21136 v40 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21137 if ( v40 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21139 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21140 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21142 if ( v9 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21144 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21145 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21146 if ( v10 & 0x80000 || ((Actor *)(v0 - 36))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21148 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21149 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21150 if ( v11 && (double)v40 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21151 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21152 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21153 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21155 v12 = v45++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21156 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21157 ai_array_4F7DB0_actor_ids[v12] = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21159 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21161 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21162 v0[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21164 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21165 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21167 while ( v43 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21169 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21170 if ( v45 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21172 v14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21173 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21174 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21176 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21178 v41 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21179 if ( v14 >= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21180 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21181 v15 = ai_array_4F75E0[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21182 if ( v15 > ai_array_4F75E0[v14] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21184 v16 = &ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21185 v17 = ai_array_4F7DB0_actor_ids[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21186 ai_array_4F7DB0_actor_ids[v13] = *v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21187 *v16 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21188 v14 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21189 ai_array_4F75E0[v13] = ai_array_4F75E0[v41];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21190 ai_array_4F75E0[v41] = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21192 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21194 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21195 v14 = v44 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21196 v44 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21198 while ( v14 - 1 < v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21200 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21201 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21202 for ( i = 0; v18 < v45; i = v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21204 v20 = &pActors[ai_array_4F7DB0_actor_ids[v18]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21205 if ( v20->uAttributes & 0x8000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21206 || (v21 = sub_4070EF_prolly_collide_objects(8 * ai_array_4F7DB0_actor_ids[v18] | 3, 4u), v18 = i, v21) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21208 v22 = ai_array_4F7DB0_actor_ids[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21209 v20->uAttributes |= 0x8000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21210 ai_array_4F6638_actor_ids[v19] = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21211 ai_array_4F5E68[v19++] = ai_array_4F75E0[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21212 if ( v19 >= 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21213 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21215 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21217 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21218 ai_arrays_size = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21219 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21221 v24 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21222 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21224 if ( ((Actor *)(v24 - 36))->CanAct() && *((short *)v24 + 61) == v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21226 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21227 if ( v19 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21229 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21230 v26 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21231 v24[1] |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21232 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21233 ai_array_4F6638_actor_ids[v26] = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21235 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21237 while ( ai_array_4F6638_actor_ids[v25] != v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21239 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21240 if ( v25 >= v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21241 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21245 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21246 v24 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21248 while ( v23 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21250 v27 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21251 for ( j = 0; j < v45; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21253 v29 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21254 if ( pActors[v29].uAttributes & 0xC000 && pActors[v29].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21256 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21257 if ( v27 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21259 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21260 v31 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21261 v32 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21262 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21263 ai_array_4F6638_actor_ids[v31] = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21265 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21267 while ( ai_array_4F6638_actor_ids[v30] != ai_array_4F7DB0_actor_ids[j] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21269 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21270 if ( v30 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21271 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21276 v33 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21277 if ( ai_arrays_size > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21279 v33 = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21280 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21282 memcpy(ai_array_4F7DB0_actor_ids, ai_array_4F6638_actor_ids, 4 * v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21283 memcpy(ai_array_4F75E0, ai_array_4F5E68, 4 * ai_arrays_size);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21284 v34 = (unsigned int)ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21285 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21287 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21289 v35 = (char *)&pActors[ai_array_4F7DB0_actor_ids[HIDWORD(v34)]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21290 v35[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21291 ++HIDWORD(v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21293 while ( SHIDWORD(v34) < (signed int)v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21295 return v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21297 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21298
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21299 //----- (00401A91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21300 void __cdecl sub_401A91_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21302 unsigned int v0; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21303 int v1; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21304 int v2; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21305 int v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21306 signed int v4; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21307 char *v5; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21308 signed int v6; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21309 __int16 v7; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21310 Player **v8; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21311 Player *pPlayer; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21312 Actor *pActor; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21313 __int16 v11; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21314 unsigned int v12; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21315 signed int v13; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21316 SpellBuff *v14; // ebx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21317 unsigned int v15; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21318 char *v16; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21319 unsigned int v17; // edx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21320 unsigned int v18; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21321 unsigned __int16 v19; // ax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21322 int *v20; // esi@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21323 Actor *v21; // ebx@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21324 unsigned __int16 v22; // ax@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21325 signed int v23; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21326 unsigned int v24; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21327 signed int v25; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21328 SpellBuff *v26; // esi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21329 unsigned int v27; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21330 unsigned int v28; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21331 unsigned int v29; // eax@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21332 AIDirection *v30; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21333 unsigned __int16 v31; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21334 unsigned int v32; // esi@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21335 int v33; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21336 int v34; // eax@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21337 char v35; // al@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21338 unsigned int v36; // edi@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21339 signed int v37; // eax@154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21340 unsigned __int8 v38; // sf@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21341 unsigned __int8 v39; // of@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21342 signed int v40; // edx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21343 unsigned int v41; // ecx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21344 double v42; // st7@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21345 double v43; // st6@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21346 bool v44; // eax@189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21347 bool v45; // eax@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21348 unsigned __int8 v46; // cl@197
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21349 double v47; // st7@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21350 double v48; // st7@207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21351 char v49; // zf@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21352 char v50; // zf@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21353 signed int v51; // edx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21354 unsigned int v52; // ecx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21355 __int16 v53; // fps@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21356 unsigned __int8 v54; // c0@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21357 unsigned __int8 v55; // c3@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21358 double v56; // st7@226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21359 AIDirection *v57; // eax@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21360 double v58; // st7@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21361 signed int v59; // [sp-18h] [bp-C8h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21362 int v60; // [sp-14h] [bp-C4h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21363 int v61; // [sp-14h] [bp-C4h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21364 AIDirection *v62; // [sp-14h] [bp-C4h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21365 signed int v63; // [sp-14h] [bp-C4h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21366 unsigned int v64; // [sp-14h] [bp-C4h]@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21367 unsigned int v65; // [sp-10h] [bp-C0h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21368 char v66; // [sp-10h] [bp-C0h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21369 AIDirection *v67; // [sp-10h] [bp-C0h]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21370 int v68; // [sp-10h] [bp-C0h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21371 AIDirection *v69; // [sp-10h] [bp-C0h]@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21372 int v70; // [sp-10h] [bp-C0h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21373 AIDirection *v71; // [sp-10h] [bp-C0h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21374 AIDirection v72; // [sp+0h] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21375 AIDirection a3; // [sp+1Ch] [bp-94h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21376 AIDirection v74; // [sp+38h] [bp-78h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21377 AIDirection v75; // [sp+54h] [bp-5Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21378 int v76; // [sp+70h] [bp-40h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21379 signed int a1; // [sp+74h] [bp-3Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21380 int v78; // [sp+78h] [bp-38h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21381 AIDirection pDir; // [sp+7Ch] [bp-34h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21382 float v80; // [sp+98h] [bp-18h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21383 int v81; // [sp+9Ch] [bp-14h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21384 int v82; // [sp+A0h] [bp-10h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21385 unsigned int uActorID; // [sp+A4h] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21386 unsigned int v84; // [sp+A8h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21387 signed int a2; // [sp+ACh] [bp-4h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21388
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21389 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21390 ODM_4014E6_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21391 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21392 BLV_4016FA_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21393 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21394 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor && pParty->field_1613C > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21396 if ( pParty->field_1613C > 417 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21398 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21400 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21402 pParty->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (pParty->sRotationY + rand() % 16 - 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21403 v1 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21404 v2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21405 v3 = pParty->sRotationX + v1 % 16 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21406 pParty->sRotationX = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21407 if ( v3 > 128 || (v2 = -128, v3 < -128) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21408 pParty->sRotationX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21409 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21410 pParty->field_1613C -= pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21411 v4 = pParty->field_16140 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21412 if ( pParty->field_1613C <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21414 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21415 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21416 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21418 v5 = (char *)&pActors[0].sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21419 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21421 if ( ((Actor *)(v5 - 40))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21423 v6 = stru_50C198.CalcMagicalDamageToActor((Actor *)(v5 - 40), 5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21424 v7 = *(short *)v5 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21425 *(short *)v5 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21426 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21428 if ( v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21430 Actor::_4030AD(v84, 4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21432 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21434 Actor::Die(v84);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21435 if ( *((int *)v5 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21436 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[*((short *)v5 + 28)].uExp);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21440 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21441 v5 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21443 while ( (signed int)v84 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21445 v8 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21446 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21448 pPlayer = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21449 if ( !(*v8)->pConditions[14] && !pPlayer->pConditions[15] && !pPlayer->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21450 pPlayer->ReceiveDamage(v4, 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21451 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21453 while ( (signed int)v8 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21454 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21456 if ( pTurnEngine->field_1C != v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21457 --pTurnEngine->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21460 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21462 pTurnEngine->_405E14();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21463 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21465 uActorID = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21466 if ( (signed int)uNumActors > (signed int)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21468 LODWORD(v80) = (int)(char *)pActors + 176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21469 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21471 pActor = (Actor *)(LODWORD(v80) - 176);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21472 v11 = *(unsigned int *)LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21473 v49 = *(unsigned int *)LODWORD(v80) == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21474 dword_4F6E08[uActorID] = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21475 if ( v49 || v11 == 11 || v11 == 19 || *(char *)(LODWORD(v80) - 139) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21476 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21477 if ( !*(short *)(LODWORD(v80) - 136) && v11 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21478 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21479 v84 = *(_QWORD *)(LODWORD(v80) + 84) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21480 v82 = *(_QWORD *)(LODWORD(v80) + 52) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21481 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21482 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21483 v14 = (SpellBuff *)(LODWORD(v80) + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21484 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21486 if ( v13 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21488 v14->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21489 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21491 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21492 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21494 while ( v13 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21495 if ( v84 != v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21496 && SHIDWORD(pActor->pActorBuffs[3].uExpireTime) <= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21497 && (SHIDWORD(pActor->pActorBuffs[3].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21498 || LODWORD(pActor->pActorBuffs[3].uExpireTime) <= v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21499 pActor->uActorHeight = pMonsterList->pMonsters[pActor->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21500 if ( v82 != v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21502 pActor->pMonsterInfo.uHostilityType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21503 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) <= (signed int)v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21505 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21506 || LODWORD(pActor->pActorBuffs[1].uExpireTime) <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21507 pActor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].uHostilityType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21510 if ( SHIDWORD(pActor->pActorBuffs[5].uExpireTime) > (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21511 || SHIDWORD(pActor->pActorBuffs[5].uExpireTime) >= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21512 && LODWORD(pActor->pActorBuffs[5].uExpireTime)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21513 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) > 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21514 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) >= 0 && LODWORD(pActor->pActorBuffs[6].uExpireTime) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21515 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21516 v15 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21517 v16 = (char *)&pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21518 pActor->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21519 v17 = pActor->uCurrentActionTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21520 v18 = pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21521 if ( (signed int)v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21522 *(int *)v16 = v18 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21523 if ( *(int *)v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21524 *(int *)v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21525 if ( (signed int)v17 < pActor->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21526 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21527 v19 = pActor->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21528 if ( v19 == Dying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21530 pActor->uAIState = Dead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21532 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21534 if ( v19 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21536 Actor::_403F58(uActorID, Dying, 256, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21537 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21539 pActor->uAIState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21541 pActor->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21542 pActor->uCurrentActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21543 pActor->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21544 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21545 ++uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21546 LODWORD(v80) += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21548 while ( (signed int)uActorID < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21550 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21551 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21553 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21555 uActorID = ai_array_4F7DB0_actor_ids[v78];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21556 v20 = &dword_4F6E08[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21557 v21 = &pActors[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21558 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21559 if ( v21->pMonsterInfo.uHostilityType && !*v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21560 v21->pMonsterInfo.uHostilityType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21561 a2 = *v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21562 v76 = a2 & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21563 if ( (a2 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21564 v80 = 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21566 v80 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21567 v22 = v21->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21568 if ( v22 == 4 || v22 == 5 || v22 == 11 || v22 == 19 || v22 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21569 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21570 if ( !v21->sCurrentHP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21571 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21572 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21574 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21575 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21577 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21579 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21580 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21582 if ( (signed __int64)v21->pActorBuffs[1].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21583 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21584 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21585 v82 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21586 if ( (signed __int64)v21->pActorBuffs[2].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21587 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21588 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21589 v81 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21590 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21591 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21592 v26 = v21->pActorBuffs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21593 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21595 if ( v25 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21597 v26->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21598 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21600 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21601 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21602 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21603 while ( v25 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21604 if ( v84 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21605 && SHIDWORD(v21->pActorBuffs[3].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21606 && (SHIDWORD(v21->pActorBuffs[3].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21607 || LODWORD(v21->pActorBuffs[3].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21608 v21->uActorHeight = pMonsterList->pMonsters[v21->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21609 if ( v82 != v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21611 v21->pMonsterInfo.uHostilityType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21612 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) <= (signed int)v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21614 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21615 || LODWORD(v21->pActorBuffs[1].uExpireTime) <= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21616 v21->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[v21->pMonsterInfo.uID].uHostilityType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21619 if ( v81 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21620 && SHIDWORD(v21->pActorBuffs[2].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21621 && (SHIDWORD(v21->pActorBuffs[2].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21622 || LODWORD(v21->pActorBuffs[2].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21624 v21->uAIState = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21625 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21627 if ( v21->pActorBuffs[5].uExpireTime || v21->pActorBuffs[6].uExpireTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21628 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21629 v27 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21630 v28 = v21->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21631 v21->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21632 if ( (signed int)v28 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21633 v21->pMonsterInfo.uRecoveryTime = v28 - v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21634 if ( (v21->pMonsterInfo.uRecoveryTime & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21635 v21->pMonsterInfo.uRecoveryTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21636 v29 = v21->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21637 if ( !(v29 & 0x8000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21638 v21->uAttributes = v29 | 0x8000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21639 a1 = 8 * uActorID | 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21640 v30 = Actor::GetDirectionInfo(8 * uActorID | 3, a2, &a3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21641 v49 = v21->pMonsterInfo.uHostilityType == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21642 memcpy(&v75, v30, sizeof(v75));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21643 memcpy(&pDir, &v75, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21644 if ( !v49 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21646 if ( v80 * 307.2 >= (double)(signed int)v75.uDistance
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21647 && ((v31 = v21->uAIState, v31 == 6) || !v31 || v31 == 1 || v31 == 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21648 || v21->pMonsterInfo.uMissleAttack1Type && v21->uAIState == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21650 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21651 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21654 if ( (signed int)v21->uCurrentActionTime < v21->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21655 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21656 if ( v21->uAIState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21658 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21659 v35 = stru_50C198.special_ability_use_check(v21, uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21660 stru_50FE08.Add(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21661 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21662 5120,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21663 v21->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21664 v21->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21665 v21->vPosition.z + ((signed int)v21->uActorHeight >> 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21666 v35,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21667 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21668 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21669 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21670 if ( v21->uAIState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21672 v34 = v21->pMonsterInfo.uMissleAttack1Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21673 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21674 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21676 if ( v21->uAIState == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21677 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21678 v34 = v21->pMonsterInfo.uMissleAttack2Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21679 v66 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21680 LABEL_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21681 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21682 Actor::_404874(uActorID, &pDir, v34, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21683 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21685 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21686 if ( v21->uAIState == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21687 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21688 if ( v21->uAIState == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21690 v65 = v21->pMonsterInfo.uSpellSkillAndMastery2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21691 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21692 v33 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21693 LABEL_146:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21694 Actor::_404AC7(uActorID, &pDir, v33, v60, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21696 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21697 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21698 if ( v21->pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21699 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21700 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21702 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21703 v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (v21->pMonsterInfo.uID - 1) / 3]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21704 + (pActors[a2 >> 3].pMonsterInfo.uID - 1) / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21706 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21708 v37 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21710 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21711 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21712 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21714 v39 = __OFSUB__(v36, 1024);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21715 v38 = ((v36 - 1024) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21717 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21719 if ( v37 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21721 v39 = __OFSUB__(v36, 2560);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21722 v38 = ((v36 - 2560) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21724 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21726 if ( v37 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21727 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21728 v39 = __OFSUB__(v36, 5120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21729 v38 = ((v36 - 5120) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21732 if ( v38 ^ v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21733 LABEL_257:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21734 v21->pMonsterInfo.uHostilityType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21735 LABEL_165:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21736 if ( (signed __int64)v21->pActorBuffs[4].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21738 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21739 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21740 if ( (signed int)v36 >= 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21742 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21743 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21744 goto LABEL_253;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21746 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21747 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21749 if ( v21->pMonsterInfo.uHostilityType != 4 || !a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21750 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21751 if ( !(v21->uAttributes & 0x020000) || v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21753 if ( v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21755 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21756 if ( v21->pMonsterInfo.uMovementType != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21757 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21758 Actor::_403EB6(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21759 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21760 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21761 (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21762 &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21764 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21766 if ( v21->pMonsterInfo.uAIType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21768 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21769 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21770 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21772 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21774 if ( v21->pMonsterInfo.uAIType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21775 goto LABEL_185;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21776 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21777 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21778 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21779 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21780 if ( v43 > v42 && (signed int)v36 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21782 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21783 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21784 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21785 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21786 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21787 Actor::_402968(v41, v40, 0, v67);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21788 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21792 LABEL_185:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21793 v81 = v36 - v21->uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21794 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21795 v81 -= pActors[a2 >> 3].uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21796 if ( v81 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21797 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21798 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21799 v44 = (signed int)v21->pMonsterInfo.uRecoveryTime <= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21800 v21->uAttributes &= 0xFBFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21801 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21802 v49 = v21->pMonsterInfo.uMovementType == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21803 v84 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21804 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21805 v82 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21806 if ( v81 >= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21807 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21808 v45 = stru_50C198.special_ability_use_check(v21, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21809 if ( !v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21811 if ( v21->pMonsterInfo.uMissleAttack1Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21813 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21815 Actor::_403476(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21816 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21818 LABEL_223:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21819 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21820 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21821 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21822 //UNDEF(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21823 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21824 if ( !(v54 | v55) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21825 goto LABEL_219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21826 LABEL_225:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21827 Actor::_402AD7(v32, a2, v32, (signed __int64)v47, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21828 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21830 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21831 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21833 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21835 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21836 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21837 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21838 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21839 goto LABEL_240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21841 goto LABEL_235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21843 goto LABEL_227;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21845 if ( v45 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21847 if ( v45 > 1 && v45 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21849 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21850 v46 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21851 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21852 v46 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21853 if ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21855 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21857 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21858 Actor::_403854(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21859 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21860 Actor::_403A60(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21861 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21863 if ( v80 * 307.2 > (double)v81 || v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21864 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21865 LABEL_217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21866 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21867 LABEL_218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21868 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21869 LABEL_219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21870 v51 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21871 v64 = (signed __int64)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21872 v52 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21873 LABEL_247:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21874 Actor::_403EB6(v52, v51, v64, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21875 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21877 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21878 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21879 goto LABEL_225;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21881 v48 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21882 if ( (double)v81 >= v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21884 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21886 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21887 LABEL_215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21888 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21889 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21890 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21891 v63 = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21892 LABEL_240:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21893 Actor::_402686(v32, a2, v63, v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21894 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21896 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21897 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21898 v70 = (signed __int64)v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21899 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21900 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21901 goto LABEL_237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21903 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21904 goto LABEL_209;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21906 LABEL_241:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21907 if ( !v21->pMonsterInfo.uMovementType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21909 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21910 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21911 LABEL_252:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21912 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21913 v40 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21914 LABEL_253:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21915 Actor::_4032B2(v41, v40, v61, v68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21916 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21917 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21918 if ( v21->pMonsterInfo.uMovementType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21919 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21920 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21921 v61 = 2560;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21922 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21924 if ( v21->pMonsterInfo.uMovementType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21926 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21927 v61 = 5120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21928 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21930 if ( v21->pMonsterInfo.uMovementType == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21932 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21933 v61 = 10240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21934 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21936 if ( v21->pMonsterInfo.uMovementType == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21938 v57 = Actor::GetDirectionInfo(a1, 4u, &v72, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21939 v58 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21940 memcpy(&v74, v57, sizeof(v74));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21941 memcpy(&pDir, &v74, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21942 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21943 v52 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21944 v64 = (signed __int64)v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21945 v51 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21946 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21948 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21950 if ( !v21->pMonsterInfo.uMissleAttack2Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21952 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21953 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21955 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21957 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21958 goto LABEL_215;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21960 LABEL_235:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21961 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21962 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21963 v70 = (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21964 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21965 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21966 LABEL_237:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21967 Actor::_40281C(v32, a2, v59, v62, v70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21968 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21970 LABEL_227:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21971 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21972 LABEL_209:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21973 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21974 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21975 goto LABEL_218;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21976 Actor::_403C6C(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21977 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21979 if ( !v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21980 goto LABEL_223;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21981 Actor::_40368B(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21982 LABEL_254:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21983 ++v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21984 if ( v78 >= ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21985 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21987 v65 = v21->pMonsterInfo.uSpellSkillAndMastery1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21988 v60 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21989 v33 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21990 goto LABEL_146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21993
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21995
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21996
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21997 //----- (0040261D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21998 int stru298::Add(__int16 uID, __int16 a3, __int16 x, __int16 y, __int16 z, char a7, char a8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22000 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22001
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22002 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22003 if ( this->count < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22005 this->pIDs[result] = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22006 this->pXs[this->count] = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22007 this->pYs[this->count] = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22008 this->pZs[this->count] = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22009 this->field_324[this->count] = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22010 this->field_3EC[this->count] = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22011 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22012 this->field_450[this->count++] = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22014 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22016
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22017
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22018
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22019
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22020
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22021 //----- (00402CAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22022 int stru193_math::SinCos(int angle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22024 unsigned int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22025 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22026 int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22027
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22028 v2 = this->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22029 v3 = this->uDoublePiMask & angle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22030 if ( (signed int)v3 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22031 v3 = this->uIntegerDoublePi - v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22032 if ( (signed int)v3 >= (signed int)this->uIntegerHalfPi )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22033 result = -this->pCosTable[v2 - v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22034 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22035 result = this->pCosTable[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22036 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22038
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22039
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22040
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22041
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22042
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22043
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22044
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22046
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22047
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22048
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22049
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22050
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22051
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22052 //----- (00404544) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22053 signed int stru262_TurnBased::_404544()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22055 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22056 TurnBased_QueueElem *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22057 Actor *v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22058 Actor *v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22059 Player *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22060 int v6; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22061 TurnBased_QueueElem *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22062 TurnBased_QueueElem *v8; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22063 int v9; // edx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22064 int v10; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22065 int v11; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22066 int v12; // ST0C_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22067 int v13; // ST10_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22068 int v14; // ST14_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22069 int v15; // ST18_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22070 signed int result; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22071 TurnBased_QueueElem *v17; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22072 int v18; // [sp+20h] [bp-Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22073 int v19; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22074 int v20; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22075 signed int v21; // [sp+28h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22076 int v22; // [sp+28h] [bp-4h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22077
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22078 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22079 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22080 v19 = this->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22081 if ( this->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22083 v2 = this->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22084 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22086 if ( (v2->uPackedID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22088 v3 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22089 v4 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22090 LOBYTE(v4->uAttributes) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22091 if ( !v4->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22093 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22094 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22095 LOBYTE(v3->uAttributes) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22096 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22098 if ( (v2->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22100 v5 = &pParty->pPlayers[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22101 if ( v5->pConditions[14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22102 || v5->pConditions[16]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22103 || v5->pConditions[15]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22104 || v5->pConditions[13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22105 || v5->pConditions[12]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22106 || v5->pConditions[2] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22108 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22109 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22112 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22113 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22115 while ( v20 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22117 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22118 if ( v6 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22120 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22121 v7 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22122 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22124 v18 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22125 if ( v21 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22127 v8 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22128 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22130 v9 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22131 v10 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22132 if ( v9 < v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22133 || v9 == v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22134 && ((v11 = v8->uPackedID & 7, v11 == 4) && (v7->uPackedID & 7) == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22135 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22137 v12 = v7->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22138 v13 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22139 v14 = v7->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22140 v15 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22141 v7->uPackedID = v8->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22142 v7->field_4 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22143 v7->uActionLength = v8->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22144 v7->field_C = v8->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22145 v8->uPackedID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22146 v8->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22147 v8->uActionLength = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22148 v8->field_C = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22150 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22151 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22153 while ( v18 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22155 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22156 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22157 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22159 while ( v21 - 1 < v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22161 v1->uActorQueueSize = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22162 result = v1->pQueue[0].uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22163 if ( (v1->pQueue[0].uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22165 result = (result >> 3) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22166 uActiveCharacter = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22167 v1->field_18 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22169 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22171 uActiveCharacter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22172 v1->field_18 &= 0xFFFFFFFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22174 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22175 if ( v1->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22177 v17 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22178 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22180 if ( (v17->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22181 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22182 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22183 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22184 result = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22186 while ( v22 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22188 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22191 //----- (0040471C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22192 int stru262_TurnBased::_40471C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22194 int result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22195
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22196 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22198 if ( pTurnEngine->field_4 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22199 result = _406457(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22201 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22204
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22205 //----- (00404828) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22206 LayingItem::LayingItem()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22208 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22209
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22210 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22211 v1->field_22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22212 v1->uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22213 v1->uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22214 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22215 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22216 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22217 v1->uItemType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22218 v1->uObjectDescID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22219 v1->field_61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22220 v1->field_60_distance_related_prolly_lod = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22221 v1->field_20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22222 v1->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22223 v1->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22224 v1->field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22225 v1->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22226 v1->field_54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22231 //----- (004059DB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22232 signed int stru262_TurnBased::Start()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22234 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22235 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22236 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22237 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22238 unsigned int v5; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22239 Actor *v6; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22240 unsigned int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22241 unsigned int v8; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22242 unsigned __int8 v9; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22243 unsigned __int8 v10; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22244 unsigned __int8 v11; // of@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22245 char *v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22246 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22247 unsigned __int16 v14; // ax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22248 int v15; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22249 signed __int64 v16; // qax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22250 int v17; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22251 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22252 char *v19; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22253 int v20; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22254 char *v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22255 int v22; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22256 int v23; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22257 char *v24; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22258 char *v25; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22259 int v26; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22260 int v27; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22261 int v28; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22262 AIDirection v30; // [sp+Ch] [bp-68h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22263 AIDirection v31; // [sp+28h] [bp-4Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22264 AIDirection a3; // [sp+44h] [bp-30h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22265 int v33; // [sp+60h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22266 int *v34; // [sp+64h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22267 int v35; // [sp+68h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22268 int v40; // [sp+6Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22269 unsigned int v37; // [sp+70h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22270
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22271 pTurnEngine->field_18 &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22272 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22273 pEventTimer->TrackGameTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22274 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22275 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22276 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22277 v40 = (int)pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22278 dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22279 dword_50C994 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22280 v1->field_10 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22281 v1->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22282 v1->field_8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22283 v1->field_4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22284 v1->uActorQueueSize = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22285 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22286 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22288 if ( ((Player *)v40)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22290 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = 8 * v3 | OBJECT_Player;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22291 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22292 v1->pQueue[v1->uActorQueueSize].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22293 pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22295 v40 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22296 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22298 while ( v40 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22299 v35 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22300 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22301 v40 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22302 if ( v40 < v40 + ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22304 v34 = (int *)ai_array_4F7DB0_actor_ids;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22305 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22307 v37 = *v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22308 v5 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22309 v6 = &pActors[v37];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22310 if ( v37 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22312 if ( pActors[v37].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22314 v7 = v6->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22315 if ( v7 & 0x8000 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22317 v8 = dword_4F6E08[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22318 LOBYTE(v7) = v7 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22319 v6->uAttributes = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22320 v33 = 8 * v5 | OBJECT_Actor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22321 memcpy(&v31, Actor::GetDirectionInfo(8 * v5 | OBJECT_Actor, v8, &a3, 0), sizeof(v31));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22322 memcpy(&v30, &v31, sizeof(v30));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22323 Actor::_403F58(v37, 4, 32, &v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22324 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22325 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22326 v1->pQueue[v1->uActorQueueSize++].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22329 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22331 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22332 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22334 while ( v40 < v4 + ai_arrays_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22335 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22337 v11 = __OFSUB__(v1->uActorQueueSize, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22338 v9 = v1->uActorQueueSize == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22339 v10 = ((v1->uActorQueueSize - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22340 v37 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22341 v40 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22342 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22344 v12 = (char *)&v1->pQueue[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22345 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22347 v13 = *((int *)v12 - 1) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22348 if ( v13 != OBJECT_Player )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22349 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22350 v14 = pPlayers[(*((int *)v12 - 1) >> 3) + 1]->uTimeToRecovery;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22351 if ( v14 != (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22353 v33 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22354 v16 = (signed __int64)((double)v14 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22355 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22356 *(int *)v12 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22357 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22359 v15 = v37++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22360 *(&a3.uDistance + v15) = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22361 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22362 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22363 v12 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22364 if ( v40 >= v1->uActorQueueSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22365 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22367 if ( v13 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22369 *(int *)v12 = 666;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22370 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22372 v17 = rand() % 99;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22373 if ( v17 < 33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22375 *(int *)v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22376 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22378 LODWORD(v16) = SHIDWORD(v16) < 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22379 LOBYTE(v16) = SHIDWORD(v16) >= 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22380 LODWORD(v16) = 2 * v16 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22381 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22383 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22384 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22385 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22387 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22389 *(&v31.uDistance + v18) = pParty->pPlayers[*(&v1->field_0 + 4 * (*(&a3.uDistance + v18) + 2)) >> 3].GetAttackRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22390 v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22391 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22393 while ( (signed int)v18 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22394 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22396 v35 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22397 v34 = (int *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22398 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22400 v40 = (int)v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22401 if ( (signed int)v34 < (signed int)v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22403 v19 = (char *)&v31.uDistance + v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22404 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22406 v20 = *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22407 v33 = 4 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22408 v21 = (char *)(&v31.uDistance + v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22409 v22 = *(int *)v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22410 if ( *(int *)v21 < v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22412 *(int *)v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22413 v23 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22414 *(int *)v19 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22415 v24 = (char *)&a3.uDistance + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22416 v25 = (char *)&a3.uDistance + v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22417 v26 = *(int *)v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22418 *(int *)v24 = *(unsigned int *)((char *)&a3.uDistance + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22419 *(int *)v25 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22420 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22422 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22424 while ( v40 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22426 v34 = (int *)((char *)v34 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22427 v35 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22429 while ( (signed int)((char *)v34 - 1) < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22430 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22432 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22434 v27 = v2 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22435 v28 = *(&a3.uDistance + v2++);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22436 v11 = __OFSUB__(v2, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22437 v10 = ((v2 - v37) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22438 v1->pQueue[v28].field_4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22440 while ( v10 ^ v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22444 return v1->_404544();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22446