annotate mm7_3.cpp @ 44:916bec351934

22.10.12(pCurrentScreen)
author Ritor1
date Mon, 22 Oct 2012 17:28:15 +0600
parents f4450ff595fe
children 79a30ee1ecdb 6a62c4005f0e
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"
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
42 #include "Log.h"
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 #include "mm7_data.h"
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 //----- (0046E44E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 int __thiscall _46E44E_collide_against_faces_and_portals(unsigned int b1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 BLVSector *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 BLVFace *v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 __int16 v4; // si@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 int v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 unsigned __int8 v6; // sf@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 unsigned __int8 v7; // of@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 int result; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 BLVSector *v9; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 int v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 int v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 BLVFace *v12; // ebp@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 int v13; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 int v14; // esi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 int v16; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 int v17; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 unsigned int v18; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 int v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 int v20; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 int v21; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 int v22; // ecx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 int v23; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 unsigned int v24; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 int a3; // [sp+10h] [bp-48h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 int v26; // [sp+14h] [bp-44h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 int i; // [sp+18h] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 int a10; // [sp+1Ch] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 int v29; // [sp+20h] [bp-38h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 int v30; // [sp+24h] [bp-34h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 int v31; // [sp+28h] [bp-30h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 int v32; // [sp+2Ch] [bp-2Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 int v33[10]; // [sp+30h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 v1 = &pIndoor->pSectors[stru_721530.uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 a10 = b1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 v33[0] = stru_721530.uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 for ( i = 1; v2 < v1->uNumPortals; ++v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 v3 = &pIndoor->pFaces[v1->pPortals[v2]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 if ( stru_721530.sMaxX <= v3->pBounding.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 && stru_721530.sMinX >= v3->pBounding.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 && stru_721530.sMaxY <= v3->pBounding.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 && stru_721530.sMinY >= v3->pBounding.y1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 && stru_721530.sMaxZ <= v3->pBounding.z2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 && stru_721530.sMinZ >= v3->pBounding.z1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 && abs((v3->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 + stru_721530.normal.x * v3->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 + stru_721530.normal.y * v3->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 + stru_721530.normal.z * v3->pFacePlane_old.vNormal.z) >> 16) <= stru_721530.field_6C + 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 v4 = v3->uSectorID == stru_721530.uSectorID ? v3->uBackSectorID : v3->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 v5 = i++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 v7 = __OFSUB__(i, 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 v6 = i - 10 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 v33[v5] = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 if ( !(v6 ^ v7) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 if ( i > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 v9 = &pIndoor->pSectors[v33[result]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 v32 = v9->field_4 + v9->field_C + v9->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 if ( v32 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 result = v29++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 if ( v29 >= i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 v11 = v9->pFloors[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 v12 = &pIndoor->pFaces[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 if ( v12->uAttributes & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 || stru_721530.sMaxX > v12->pBounding.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 || stru_721530.sMinX < v12->pBounding.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 || stru_721530.sMaxY > v12->pBounding.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 || stru_721530.sMinY < v12->pBounding.y1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 || stru_721530.sMaxZ > v12->pBounding.z2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 || stru_721530.sMinZ < v12->pBounding.z1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 || v11 == stru_721530.field_84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 v13 = v12->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 v14 = v12->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 v31 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 v15 = (stru_721530.normal.x * v12->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 + v14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 + stru_721530.normal.y * v13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 + stru_721530.normal.z * v12->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 v16 = (stru_721530.normal2.y * v31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 + v12->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 + stru_721530.normal2.z * v12->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 + stru_721530.normal2.x * v12->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 if ( v15 <= stru_721530.prolly_normal_d || v16 <= stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 if ( v16 <= v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 a3 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 if ( sub_47531C(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 stru_721530.prolly_normal_d,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 &a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 stru_721530.normal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169 stru_721530.normal.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170 stru_721530.normal.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 v17 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 a3 = stru_721530.field_6C + stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 if ( !sub_475D85(&stru_721530.normal, &stru_721530.field_58, &a3, v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184 v17 = a3 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 a3 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 if ( v17 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189 stru_721530.field_7C = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 v18 = 8 * v9->pFloors[v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 LOBYTE(v18) = v18 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 stru_721530.uFaceID = v18;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 if ( !(stru_721530.field_0 & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 || (v19 = v12->pFacePlane_old.vNormal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 v20 = v12->pFacePlane_old.vNormal.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 v30 = v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202 v21 = (stru_721530.field_34.x * v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 + v12->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 + stru_721530.field_34.y * v20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 + stru_721530.field_34.z * v12->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 v21 <= 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 || (v22 = (stru_721530.field_4C * v30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208 + v12->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 + stru_721530.field_50 * v20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 + stru_721530.field_54 * v12->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 v21 > stru_721530.prolly_normal_d)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 && v22 > stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 || v22 > v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 a3 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 if ( sub_47531C(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 stru_721530.field_8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 &a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 stru_721530.field_34.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 stru_721530.field_34.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 stru_721530.field_34.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 v23 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 a3 = stru_721530.field_6C + stru_721530.field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 if ( sub_475D85(&stru_721530.field_34, &stru_721530.field_58, &a3, v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 v23 = a3 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 a3 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 if ( v23 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 stru_721530.field_7C = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240 v24 = 8 * v9->pFloors[v26];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241 LOBYTE(v24) = v24 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 stru_721530.uFaceID = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 v10 = v26++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 if ( v26 >= v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 // 46E44E: using guessed type int var_28[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 //----- (0046E889) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 int __fastcall _46E889_collide_against_bmodels(unsigned int ecx0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 BSPModel *v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 int v3; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 ODMFace *v4; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 int v5; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 int v6; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 unsigned int v7; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 int v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 int v9; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 int v10; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 int v11; // ST18_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 int v12; // ST1C_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 int v13; // ST0C_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 unsigned int v14; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 int v15; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 int v16; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 unsigned int v17; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 int v18; // ST18_4@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 int v19; // ST1C_4@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 int v20; // ST0C_4@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 int v21; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 unsigned int v22; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 //BLVFace f; // [sp+Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 int v24; // [sp+6Ch] [bp-1Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 int a11; // [sp+70h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 unsigned int v26; // [sp+74h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 unsigned int v27; // [sp+78h] [bp-10h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 BSPModel *v28; // [sp+7Ch] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 int a10; // [sp+80h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 int a2; // [sp+84h] [bp-4h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 a11 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 BLVFace f; // [sp+Ch] [bp-7Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 //BLVFace::BLVFace(&f);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 a10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 v26 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 v2 = &pOutdoor->pBModels[v26 / 0xBC];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 v28 = &pOutdoor->pBModels[v26 / 0xBC];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 if ( stru_721530.sMaxX <= pOutdoor->pBModels[v26 / 0xBC].sMaxX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 if ( stru_721530.sMinX >= v2->sMinX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 if ( stru_721530.sMaxY <= v2->sMaxY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 if ( stru_721530.sMinY >= v2->sMinY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 if ( stru_721530.sMaxZ <= v2->sMaxZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 if ( stru_721530.sMinZ >= v2->sMinZ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 v24 = v2->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 if ( v24 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 break;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 ++a10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 v26 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 result = a10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 if ( a10 >= (signed int)pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 v4 = &v2->pFaces[v27 / 0x134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 if ( stru_721530.sMaxX > v4->pBoundingBox.x2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 || stru_721530.sMinX < v4->pBoundingBox.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 || stru_721530.sMaxY > v4->pBoundingBox.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 || stru_721530.sMinY < v4->pBoundingBox.y1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 || stru_721530.sMaxZ > v4->pBoundingBox.z2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 || stru_721530.sMinZ < v4->pBoundingBox.z1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 f.pFacePlane_old.vNormal.x = v4->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 f.pFacePlane_old.vNormal.y = v4->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 v5 = v4->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 f.pFacePlane_old.vNormal.z = v4->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 v6 = v4->pFacePlane.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348 f.pFacePlane_old.dist = v4->pFacePlane.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 v7 = v4->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350 f.uAttributes = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 f.pBounding.x1 = v4->pBoundingBox.x1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 f.pBounding.y1 = v4->pBoundingBox.y1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353 f.pBounding.z1 = v4->pBoundingBox.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 f.pBounding.x2 = v4->pBoundingBox.x2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 f.pBounding.y2 = v4->pBoundingBox.y2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 f.pBounding.z2 = v4->pBoundingBox.z2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357 f.zCalc1 = v4->zCalc1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 f.zCalc2 = v4->zCalc2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 f.zCalc3 = v4->zCalc3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360 f.pXInterceptDisplacements = v4->pXInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 f.pYInterceptDisplacements = v4->pYInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 f.pZInterceptDisplacements = v4->pZInterceptDisplacements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363 f.uPolygonType = (PolygonType)v4->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 f.uNumVertices = v4->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 f.uBitmapID = v4->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366 f.pVertexIDs = v4->pVertexIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 if ( !(v7 & 0x20000000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369 if ( !(v7 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 v2 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 v27 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 if ( v3 >= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 v8 = (v5 * stru_721530.normal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 + v6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 + f.pFacePlane_old.vNormal.y * stru_721530.normal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 + f.pFacePlane_old.vNormal.x * stru_721530.normal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 v9 = (v5 * stru_721530.normal2.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 + v6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 + f.pFacePlane_old.vNormal.y * stru_721530.normal2.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 + f.pFacePlane_old.vNormal.x * stru_721530.normal2.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 if ( v8 <= stru_721530.prolly_normal_d || v9 <= stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 if ( v9 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 a2 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 if ( sub_4754BF(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 stru_721530.prolly_normal_d,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 stru_721530.normal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 stru_721530.normal.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 stru_721530.normal.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 a11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 v10 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 v11 = stru_721530.field_58.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 v12 = stru_721530.field_58.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 v13 = stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 a2 = stru_721530.prolly_normal_d + stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 if ( !sub_475F30(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 stru_721530.normal.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 v13,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 stru_721530.normal.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 v10 = a2 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 a2 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 if ( v10 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 stru_721530.field_7C = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 v14 = 8 * (v3 | (a10 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 LOBYTE(v14) = v14 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 stru_721530.uFaceID = v14;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 if ( stru_721530.field_0 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 v15 = (f.pFacePlane_old.vNormal.z * stru_721530.field_34.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 + f.pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 + f.pFacePlane_old.vNormal.y * stru_721530.field_34.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 + f.pFacePlane_old.vNormal.x * stru_721530.field_34.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 v16 = (f.pFacePlane_old.vNormal.z * stru_721530.field_54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 + f.pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 + f.pFacePlane_old.vNormal.y * stru_721530.field_50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 + f.pFacePlane_old.vNormal.x * stru_721530.field_4C) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 if ( v15 <= stru_721530.prolly_normal_d || v16 <= stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 if ( v16 <= v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 a2 = stru_721530.field_6C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 if ( sub_4754BF(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 stru_721530.field_8,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 stru_721530.field_34.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 stru_721530.field_34.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 stru_721530.field_34.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 stru_721530.field_58.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 stru_721530.field_58.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 a11) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 if ( a2 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 stru_721530.field_7C = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 v17 = 8 * (v3 | (a10 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 LOBYTE(v17) = v17 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 stru_721530.uFaceID = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 v18 = stru_721530.field_58.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 v19 = stru_721530.field_58.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 v20 = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 a2 = stru_721530.field_6C + stru_721530.field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 if ( sub_475F30(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 &f,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 stru_721530.field_34.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 v20,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 stru_721530.field_34.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 stru_721530.field_58.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 v18,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 a10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 v2 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 v21 = a2 - stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 a2 -= stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 if ( a2 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 stru_721530.field_7C = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 v22 = 8 * (v3 | (a10 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 LOBYTE(v22) = v22 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 stru_721530.uFaceID = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 goto LABEL_38;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 return result;
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 //----- (0046ED1B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 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
522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 unsigned int *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 int v8; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 int v9; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 v5 = pSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 v8 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 result = _46CEC3_get_floor_level(a1, a2, a3, *pSectorID, (int *)&pSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 if ( result != -30000 && result <= a3 + 50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 || (v7 = pIndoor->GetSector(v8, v9, a3), (*v5 = v7) != 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 && (result = _46CEC3_get_floor_level(v8, v9, a3, v7, (int *)&pSectorID), result != -30000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 *a5 = (int)pSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 result = -30000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 //----- (0046ED8A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 void __fastcall _46ED8A_collide_against_layingItems(unsigned int _this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 int v1; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 ObjectDesc *v2; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 int v3; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 int v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 int v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 int v6; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 int v8; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 int v9; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 int v10; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 int v11; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 signed int v12; // [sp+0h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 int v13; // [sp+4h] [bp-10h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 char *v14; // [sp+8h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 unsigned int v15; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 v12 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 v1 = (int)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 v14 = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 if ( *(short *)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 v2 = &pObjectList->pObjects[*(short *)v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 if ( !(v2->uFlags & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 v3 = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 v4 = *(int *)(v1 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 if ( stru_721530.sMaxX <= v4 + v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 if ( stru_721530.sMinX >= v4 - v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 v5 = *(int *)(v1 + 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 if ( stru_721530.sMaxY <= v5 + v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 if ( stru_721530.sMinY >= v5 - v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 v6 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 v7 = *(int *)(v1 + 10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 v13 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 if ( stru_721530.sMaxZ <= v7 + v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 if ( stru_721530.sMinZ >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 v8 = v4 - stru_721530.normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 v9 = v5 - stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 if ( abs(((v4 - stru_721530.normal.x) * stru_721530.field_58.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 - (v5 - stru_721530.normal.y) * stru_721530.field_58.x) >> 16) <= v3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 + stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 v10 = (v8 * stru_721530.field_58.x + v9 * stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 if ( v10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 v11 = stru_721530.normal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 + ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 if ( v11 >= *(int *)(v14 + 10) - stru_721530.prolly_normal_d )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 if ( v11 <= v13 + stru_721530.prolly_normal_d + *(int *)(v14 + 10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 if ( v10 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 sub_46DEF2(v12, v15);
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 v1 = (int)(v14 + 112);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 v14 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 while ( (signed int)v15 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 //----- (0046EF01) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 int __thiscall _46EF01_collision_chech_player(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 int v3; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 int v4; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 int v5; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 int v7; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 int v8; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 unsigned int v9; // [sp+10h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 int v10; // [sp+14h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 int v11; // [sp+18h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 v8 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 v1 = 2 * pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 result = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 v9 = pParty->uPartyHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 if ( stru_721530.sMaxX <= pParty->vPosition.x + 2 * pParty->field_14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 if ( stru_721530.sMinX >= pParty->vPosition.x - v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 if ( stru_721530.sMaxY <= pParty->vPosition.z + v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 if ( stru_721530.sMinY >= pParty->vPosition.z - v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 if ( stru_721530.sMaxZ <= (signed int)(pParty->vPosition.y + pParty->uPartyHeight) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 if ( stru_721530.sMinZ >= pParty->vPosition.y )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 v3 = stru_721530.prolly_normal_d + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 v11 = pParty->vPosition.x - stru_721530.normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 v4 = ((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 - (pParty->vPosition.z - stru_721530.normal.y) * stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 v10 = pParty->vPosition.z - stru_721530.normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 result = abs(((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 - (pParty->vPosition.z - stru_721530.normal.y) * stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 if ( result <= v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 result = v10 * stru_721530.field_58.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 v5 = (v10 * stru_721530.field_58.y + v11 * stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 if ( v5 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 v6 = ((unsigned __int64)(stru_721530.field_58.z * (signed __int64)v5) >> 16) + stru_721530.normal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 result = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 if ( v6 >= pParty->vPosition.y )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 result = v9 + pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 if ( v6 <= (signed int)(v9 + pParty->vPosition.y) || v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 result = sub_452A9E(v3 * v3 - v4 * v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 v7 = v5 - result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 if ( v7 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 if ( v7 < stru_721530.field_7C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 stru_721530.field_7C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 stru_721530.uFaceID = 4;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 //----- (0046F04E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 signed int __cdecl _46F04E_collide_against_portals()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 BLVSector *v0; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 unsigned int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 BLVFace *v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 int v4; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 int v5; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 signed int result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 BLVFace *v7; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 signed int v8; // [sp+0h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 BLVSector *v9; // [sp+4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 unsigned int v10; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 int a3; // [sp+Ch] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 int v12; // [sp+10h] [bp-4h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 v0 = &pIndoor->pSectors[stru_721530.uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 v1 = 0xFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 v10 = 0xFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 v9 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 if ( v0->uNumPortals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 v2 = v0->pPortals[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 if ( v2 != stru_721530.field_80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 v3 = &pIndoor->pFaces[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 if ( stru_721530.sMaxX <= v3->pBounding.x2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 if ( stru_721530.sMinX >= v3->pBounding.x1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 && stru_721530.sMaxY <= v3->pBounding.y2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 && stru_721530.sMinY >= v3->pBounding.y1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 && stru_721530.sMaxZ <= v3->pBounding.z2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 && stru_721530.sMinZ >= v3->pBounding.z1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 v4 = (stru_721530.normal.x * v3->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 + v3->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 + stru_721530.normal.y * v3->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 + stru_721530.normal.z * v3->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 v5 = (stru_721530.normal2.z * v3->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 + v3->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 + stru_721530.normal2.x * v3->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 + stru_721530.normal2.y * v3->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 if ( (v4 < stru_721530.prolly_normal_d || v5 < stru_721530.prolly_normal_d)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 && (v4 > -stru_721530.prolly_normal_d || v5 > -stru_721530.prolly_normal_d)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 && (a3 = stru_721530.field_6C, sub_475D85(&stru_721530.normal, &stru_721530.field_58, &a3, v3))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 && a3 < (signed int)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 v0 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 v10 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 v12 = v9->pPortals[v8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 v0 = v9;
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 while ( v8 < v0->uNumPortals );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 v1 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 if ( stru_721530.field_7C >= (signed int)v1 && (signed int)v1 <= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 stru_721530.field_80 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 v7 = &pIndoor->pFaces[v12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 if ( v7->uSectorID == stru_721530.uSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 stru_721530.uSectorID = v7->uBackSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 stru_721530.uSectorID = v7->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 stru_721530.field_7C = 268435455;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 //----- (0047050A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 int stru141::_47050A(int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 stru141 *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 signed int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 int v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 int v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 signed int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 int v10; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 int v11; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 int v12; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 int v13; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 int v14; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 int v15; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 int v16; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 int v17; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 int v18; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 int v19; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 int v20; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 int v21; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 int v22; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 int v23; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 int v24; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 int v25; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 int v26; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 int v27; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 int v28; // [sp+14h] [bp+8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 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
821 v4 = v3 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 v5 = v2->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 v2->field_64 = v3 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 v2->field_58.x = 65536 / (v3 | 1) * v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 v2->field_58.y = 65536 / (v3 | 1) * v2->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 v6 = 65536 / (v3 | 1) * v2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 v2->field_68 = 65536 / (v3 | 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 v2->field_58.z = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 if ( !a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 v7 = pEventTimer->dt_in_some_format;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 v8 = ((unsigned __int64)(v7 * (signed __int64)v4) >> 16) - v2->field_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 v2->field_6C = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 v10 = ((unsigned __int64)(v8 * (signed __int64)v2->field_58.x) >> 16) + v2->normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 v2->field_4C = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 v2->normal2.x = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 v11 = ((unsigned __int64)(v2->field_6C * (signed __int64)v2->field_58.y) >> 16) + v2->normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 v2->field_50 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 v2->normal2.y = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 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
843 v12 = v2->field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 v13 = v2->normal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 v14 = v2->normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 v15 = v2->prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 v16 = v12 + ((unsigned __int64)(v2->field_6C * (signed __int64)v2->field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 v28 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 v2->field_54 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 v17 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 if ( v13 >= v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 v17 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 v2->sMaxX = v17 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 v18 = v15 + v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 if ( v13 <= v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 v18 = v15 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 v19 = v2->normal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 v20 = v2->normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 v2->sMinX = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 v21 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 if ( v19 >= v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 v2->sMaxY = v21 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 v22 = v15 + v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 if ( v19 <= v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 v22 = v20 + v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 v23 = v2->normal2.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 v2->sMinY = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 v24 = v2->normal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 if ( v24 >= v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 v25 = v23 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 v25 = v24 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 v2->sMaxZ = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 v26 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 if ( v12 <= v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 v27 = v28 + v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 v27 = v12 + v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 v2->uFaceID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 v2->field_80 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 v2->field_88 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 v2->sMinZ = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 v2->field_7C = 0xFFFFFFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 //----- (004706C6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 void __cdecl UpdateActors_ODM()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 Actor *v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 unsigned __int16 v1; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 unsigned int v2; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 int v3; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 int v4; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 int v5; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 int v6; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 signed int v7; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 signed int v8; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 unsigned __int8 v9; // zf@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 unsigned __int8 v10; // sf@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 unsigned __int16 v11; // ax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 int v12; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 unsigned __int64 v13; // qax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 int v14; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 unsigned __int64 v15; // qax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 int v16; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 int v17; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 int v18; // edx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 int v19; // ecx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 __int16 v20; // ax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 int v21; // ebx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 int v22; // edi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 int v23; // ecx@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 __int16 v24; // ax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 int v25; // eax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 signed int v26; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 int v27; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 int v28; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926 signed int v29; // ebx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 signed int v30; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 int v31; // edi@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 signed int i; // ebx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 unsigned int v33; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 int v34; // ebx@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 int v35; // edi@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 int v36; // eax@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 unsigned __int16 v37; // cx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 signed int v38; // edx@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 signed int v39; // edi@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 BSPModel *v40; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 ODMFace *v41; // edi@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 int v42; // ebx@76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 int v43; // ecx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 int v44; // edx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 __int16 v45; // dx@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 int v46; // ecx@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 signed int v47; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 int v48; // edi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 int v49; // edi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 int v50; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 unsigned __int64 v51; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 unsigned __int8 v52; // zf@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 unsigned __int8 v53; // sf@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 unsigned __int8 v54; // of@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 int v55; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 unsigned int v56; // edi@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 int v57; // ST10_4@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 unsigned int v58; // edi@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 unsigned int v59; // ebx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 signed int v60; // eax@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 int v61; // eax@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 Vec3_int_ v62; // [sp+Ch] [bp-44h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 char v63; // [sp+18h] [bp-38h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 int v64; // [sp+1Ch] [bp-34h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 int v65; // [sp+20h] [bp-30h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 int v66; // [sp+24h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 bool v67; // [sp+28h] [bp-28h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 unsigned int v68; // [sp+2Ch] [bp-24h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 unsigned int v69; // [sp+30h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 unsigned int v70; // [sp+34h] [bp-1Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 int v71; // [sp+38h] [bp-18h]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 int v72; // [sp+3Ch] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 int v73; // [sp+40h] [bp-10h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 int v74; // [sp+44h] [bp-Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 unsigned int v75; // [sp+48h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 int v76; // [sp+4Ch] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 if ( (signed int)uNumActors <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 v0 = &pActors[v75];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 v66 = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 v65 = v0->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 v1 = v0->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 if ( v1 == 11 || v1 == 19 || v1 == 17 || !v0->uMovementSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 goto LABEL_121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 v2 = v0->pMonsterInfo.uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 v69 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 if ( MonsterStats::BelongsToSupertype(v2, MONSTER_SUPERTYPE_WATER_ELEMENTAL) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 v4 = v0->pMonsterInfo.uFlying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 v0->uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 v74 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 if ( !v0->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 v74 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 v70 = GetTerrainHeightsAroundParty(v0->vPosition.x, v0->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 v5 = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 v0->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 v0->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 v0->vPosition.z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 v0->uActorHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 &v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 (int *)&v69,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 v6 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 v7 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 v68 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 v67 = v69 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 if ( v6 > v5 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 v72 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 if ( v0->uAIState == 5 && v76 && !v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 v0->uAIState = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 goto LABEL_121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 if ( v0->uCurrentActionAnimation == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 v8 = v0->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 v9 = HIDWORD(v0->pActorBuffs[7].uExpireTime) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 v10 = SHIDWORD(v0->pActorBuffs[7].uExpireTime) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 v73 = v0->uMovementSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 if ( !v10 && (!(v10 | v9) || LODWORD(v0->pActorBuffs[7].uExpireTime) > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 v8 = (signed __int64)((double)v73 * 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 v73 = (signed __int64)((double)v73 * 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 v11 = v0->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 if ( v11 == 7 || v11 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 v8 *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 v73 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 v8 = (signed __int64)((double)v73 * flt_6BE3AC_debug_recmod1_x_1_6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 if ( v8 > 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 v8 = 1000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 v12 = stru_5C6E00->SinCos(v0->uYawAngle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 v69 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 v13 = v12 * (signed __int64)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 v73 = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 v0->vVelocity.x = WORD1(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 v69 = stru_5C6E00->SinCos(v0->uYawAngle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 v73 = (unsigned __int64)((signed int)v69 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 v9 = v74 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 v0->vVelocity.y = v69 * v8 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 v14 = stru_5C6E00->SinCos(v0->uPitchAngle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 v69 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 v15 = v14 * (signed __int64)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 v73 = v15 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 v0->vVelocity.z = WORD1(v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 v7 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 v73 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 v69 = 55000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 v73 = (unsigned __int64)(55000i64 * v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 v0->vVelocity.x = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 v73 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 v73 = (unsigned __int64)((signed int)v69 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 v9 = v74 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 v0->vVelocity.y = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 v69 = 55000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 v73 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 v73 = (unsigned __int64)(55000i64 * v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 v0->vVelocity.z = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 if ( v0->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 v16 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 v0->vPosition.z = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 v0->vVelocity.z = v16 != 0 ? 0x14 : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 if ( !v72 || v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 if ( v70 && !v72 && v67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 v18 = v0->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 v19 = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 v0->vPosition.z = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 _46DCC8_get_gravity_direction_outdoor(v19, v18, &v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 v20 = GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 v21 = v62.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 v22 = v62.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 v23 = v62.y * v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 v0->vVelocity.z += -8 * LOWORD(pEventTimer->uTimeElapsed) * v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 v73 = abs(v62.x * v0->vVelocity.x + v22 * v0->vVelocity.z + v23) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 v72 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 v0->vVelocity.x += (unsigned int)(v73 * v62.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 v72 = (unsigned __int64)(v73 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 v24 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 v72 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 v0->vVelocity.y += v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 v72 = (unsigned __int64)(v73 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 v0->vVelocity.z += v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 v0->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 if ( pParty->field_1613C != v17 && v0->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 v0->vVelocity.x += rand() % 100 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 v0->vVelocity.y += rand() % 100 - 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 v0->vVelocity.z += rand() % 100 - 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 v25 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 v0->uAIState = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 v0->uYawAngle += v25 % 32 - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 v0->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 if ( v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y < 400 && v70 == v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 v0->vVelocity.y = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 v0->vVelocity.x = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 v9 = v0->pMonsterInfo.uFlying == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 v26 = 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 v26 = v0->uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 v27 = v0->uActorHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 stru_721530.field_8 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 stru_721530.prolly_normal_d = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 stru_721530.field_C = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 stru_721530.field_70 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 v69 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 stru_721530.field_34.x = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 stru_721530.field_34.y = v0->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 stru_721530.normal.y = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 v28 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 stru_721530.normal.z = v28 + v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 stru_721530.field_34.z = v28 - v26 + stru_721530.field_C - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 if ( stru_721530.field_34.z < stru_721530.normal.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 stru_721530.field_34.z = v28 + v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 stru_721530.field_1C = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 stru_721530.field_20 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 stru_721530.field_24 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 if ( stru_721530._47050A(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 _46E889_collide_against_bmodels(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 v29 = WorldPosToGridCellZ(v0->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 v30 = WorldPosToGridCellX(v0->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 _46E26D_collide_against_sprites(v30, v29);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 _46EF01_collision_chech_player(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 _46ED8A_collide_against_layingItems(8 * v75 | 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 for ( i = 0; v31 < ai_arrays_size; ++v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 v33 = ai_array_4F7DB0_actor_ids[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 if ( v33 != v75 && _46DF1A_collide_against_actor(v33, 40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 ++i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 v71 = i > 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 if ( stru_721530.field_7C < stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 v70 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 v35 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 v36 = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 stru_721530.normal2.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 stru_721530.normal2.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 v0->uActorHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 (int *)&v63,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 &v64,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 if ( v76 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 if ( v35 < v36 + 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 v37 = v0->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 if ( v37 == 5 || v37 == 4 || v37 == 11 || v37 == 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 if ( v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 v61 = v36 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 v61 = v68 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 sub_42F960_create_object(v0->vPosition.x, v0->vPosition.y, v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 v0->uAIState = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201 v0->vPosition.x = LOWORD(stru_721530.normal2.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 v0->vPosition.y = LOWORD(stru_721530.normal2.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 v0->vPosition.z = LOWORD(stru_721530.normal2.z) - LOWORD(stru_721530.prolly_normal_d) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 v72 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 v0->vPosition.x += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 v72 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 v0->vPosition.y += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 v72 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 v38 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 v0->vPosition.z += (unsigned int)(stru_721530.field_7C * stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 v39 = v38 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 switch ( v38 & 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 if ( pParty->bTurnBasedModeOn != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 goto LABEL_97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 if ( pTurnEngine->field_4 != 2 && pTurnEngine->field_4 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 LABEL_97:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 if ( v0->pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 if ( v71 == v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 goto LABEL_99;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 LABEL_101:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 Actor::_403F58(v75, 4, v34, (AIDirection *)v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 if ( v71 != v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 goto LABEL_101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 if ( pActors[v39].pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 LABEL_99:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 Actor::_402968(v75, v38, v34, (AIDirection *)v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 LABEL_103:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 Actor::FaceObject(v75, v38, v34, (AIDirection *)v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246 if ( !v0->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 v38 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 goto LABEL_103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 v52 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 v53 = SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 v0->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 v0->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 if ( !v53 && (!(v53 | v52) || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 v47 = sub_452A9E(v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 v48 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 v0->vPosition.x - pLevelDecorations[v39].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 v0->vPosition.y - pLevelDecorations[v39].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 v71 = stru_5C6E00->SinCos(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 v70 = (unsigned __int64)(v71 * (signed __int64)v47) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 v49 = v48 - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 v0->vVelocity.x = (unsigned int)(v71 * v47) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 v50 = stru_5C6E00->SinCos(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269 v71 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 v51 = v50 * (signed __int64)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 v70 = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 v0->vVelocity.y = WORD1(v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 v40 = &pOutdoor->pBModels[v38 >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 v41 = &v40->pFaces[v39 & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 if ( !(BYTE3(v41->uFaceAttributes) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 v42 = v41->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 if ( v42 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 v43 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 v44 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 v0->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 v0->vPosition.z = LOWORD(v40->pVertices.pVertices[v41->pVertexIDs[0]].z) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 if ( v44 * v44 + v43 * v43 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 v0->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 v0->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 v72 = abs(v41->pFacePlane.vNormal.y * v0->vVelocity.y + v41->pFacePlane.vNormal.z * v0->vVelocity.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 + v41->pFacePlane.vNormal.x * v0->vVelocity.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 if ( stru_721530.field_64 >> 3 > v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 v72 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 v73 = v41->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 v73 = (unsigned __int64)(v72 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 v71 = v41->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 v71 = (unsigned __int64)(v72 * (signed __int64)v71) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 v70 = v41->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 v70 = (unsigned __int64)(v72 * (signed __int64)(signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 v0->vVelocity.x += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 v0->vVelocity.y += v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 v0->vVelocity.z += v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 if ( v42 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 v45 = v0->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 v46 = stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 - ((v41->pFacePlane.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 + v41->pFacePlane.vNormal.x * v0->vPosition.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 + v41->pFacePlane.vNormal.y * v0->vPosition.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 + v41->pFacePlane.vNormal.z * v0->vPosition.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 if ( v46 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 v0->vPosition.x += (unsigned int)(v46 * v41->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 v0->vPosition.y += (unsigned int)(v46 * v41->pFacePlane.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 v0->vPosition.z = v45 + ((unsigned int)(v46 * v41->pFacePlane.vNormal.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 v0->uYawAngle = stru_5C6E00->Atan2(v0->vVelocity.x, v0->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 v70 = v0->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 v71 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 v70 = (unsigned __int64)(58500i64 * (signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 v0->vVelocity.x = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 v70 = v0->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 v70 = (unsigned __int64)(v71 * (signed __int64)(signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 v71 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 v0->vVelocity.y = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 v70 = v0->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 v70 = (unsigned __int64)(v71 * (signed __int64)(signed int)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 ++v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 v54 = __OFSUB__(v69, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 v10 = ((v69 - 100) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 v0->vVelocity.z = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 if ( !(v10 ^ v54) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 v26 = stru_721530.prolly_normal_d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 v69 = WorldPosToGridCellX(v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 v55 = WorldPosToGridCellZ(v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 v56 = v55 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 v57 = v0->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 v71 = v55 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 v68 = WorldPosToGridCellX(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 v70 = WorldPosToGridCellZ(v0->vPosition.y) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 v58 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v69, v56) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 v59 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v68, v70) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 if ( v69 == v68 && v71 == v70 && v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 if ( !v67 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 if ( !v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 if ( MonsterStats::BelongsToSupertype(v0->pMonsterInfo.uID, MONSTER_SUPERTYPE_WATER_ELEMENTAL) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 v58 = v58 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 v59 = v59 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 if ( !v74 && v58 && !v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 v0->vPosition.x = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 v0->vPosition.y = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 if ( v0->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 v0->uYawAngle -= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 v0->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 v0->uCurrentActionLength = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 v0->uAIState = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 LABEL_121:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 while ( (signed int)v75 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 //----- (0047136C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 void LayingItem::UpdateObject_fn0_BLV(unsigned int uLayingItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 ObjectDesc *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 int v3; // ST08_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 __int16 v4; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 __int16 v5; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 BLVFace *v6; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 BLVFace *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 signed int v8; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 int v9; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 __int16 v10; // di@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 char v11; // al@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 int v12; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 int v13; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 int v14; // ebx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 signed int v15; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 BLVFace *v16; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 int v17; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 int v18; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 int v19; // ecx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 Vec3_short_ *v20; // ecx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 int v21; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 __int16 v22; // ax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 int v23; // edi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 int v24; // edi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 int v25; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 unsigned __int64 v26; // qax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 unsigned __int8 v27; // sf@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 unsigned __int8 v28; // of@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 __int16 v29; // di@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 char v30; // al@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 const char *v31; // [sp-8h] [bp-98h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 const char *v32; // [sp-8h] [bp-98h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 enum TEXTURE_TYPE v33; // [sp-4h] [bp-94h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 enum TEXTURE_TYPE v34; // [sp-4h] [bp-94h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 Particle_ Dst; // [sp+Ch] [bp-84h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 unsigned int uLayingItemID_; // [sp+74h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 ObjectDesc *v37; // [sp+78h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 int v38; // [sp+7Ch] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 int v39; // [sp+80h] [bp-10h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 int v40; // [sp+84h] [bp-Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 int v41; // [sp+88h] [bp-8h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 int v42; // [sp+8Ch] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 uLayingItemID_ = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 v1 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 v2 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 v3 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 v37 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 if ( abs(v3) > 32767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 || abs(v1->vPosition.y) > 32767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 || abs(v1->vPosition.z) > 20000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v1->uSectorID, &v38),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 v42 <= -30000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 && ((v4 = pIndoor->GetSector(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 (v1->uSectorID = v4) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 || (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
1450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 v5 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 if ( v5 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 stru_721530.field_0 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 v38 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 stru_721530.prolly_normal_d = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 v12 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 stru_721530.field_C = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 stru_721530.field_8 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 stru_721530.field_70 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 stru_721530.field_34.x = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 stru_721530.field_34.y = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 stru_721530.normal.y = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 stru_721530.field_34.z = stru_721530.prolly_normal_d + v1->vPosition.z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 stru_721530.normal.z = stru_721530.field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 stru_721530.field_1C = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 stru_721530.field_20 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 stru_721530.field_24 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 stru_721530.uSectorID = v1->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 if ( stru_721530._47050A(v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 v40 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 _46E44E_collide_against_faces_and_portals(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 _46E0B2_collide_against_decorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 if ( (v1->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 _46EF01_collision_chech_player(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 v13 = v1->field_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 v42 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 if ( (v13 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 if ( (signed int)uNumActors > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 v39 = (int)&pActors[0].word_000086_some_monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 v41 = pActors[v1->field_58 >> 3].pMonsterInfo.uID - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 v14 = (signed __int64)((double)v41 * 0.3333333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 v41 = *(short *)(v39 - 38) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 _46DF1A_collide_against_actor(v42, *((short *)&pMonsterList->pMonsters[*(short *)v39] - 73));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 ++v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 v39 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 while ( v42 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 if ( (signed int)uNumActors > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 v39 = (int)&pActors[0].word_000086_some_monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 _46DF1A_collide_against_actor(v42++, *((short *)&pMonsterList->pMonsters[*(short *)v39] - 73));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 v39 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 while ( v42 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 while ( v40 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 v1->vPosition.x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 v1->vPosition.y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 memset(&Dst, v8, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 v29 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 if ( v29 & 0x200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 Dst.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 v30 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 v34 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 v32 = "effpar01";
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 if ( v29 & 0x400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 v30 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 v34 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 v32 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 Dst.field_20 = (unsigned __int8)(v30 & 0x80) + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v32, v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 if ( v2->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 v15 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 v40 = sub_452A9E(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 v23 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 v1->vPosition.x - pLevelDecorations[v15].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 v1->vPosition.y - pLevelDecorations[v15].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 v42 = stru_5C6E00->SinCos(v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 v41 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 v24 = v23 - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 v1->vVelocity.x = (unsigned int)(v42 * v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 v25 = stru_5C6E00->SinCos(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 v42 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 v26 = v25 * (signed __int64)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 v41 = v26 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 v1->vVelocity.y = WORD1(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 if ( (stru_721530.uFaceID & 7) != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 stru_721530.field_84 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 v16 = &pIndoor->pFaces[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 if ( v16->uPolygonType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 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
1602 + v16->pFacePlane_old.vNormal.y * v1->vVelocity.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 if ( stru_721530.field_64 >> 3 > v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 v42 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 v40 = v16->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 v40 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 v41 = v16->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 v41 = (unsigned __int64)(v42 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 v39 = v16->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 v39 = (unsigned __int64)(v42 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 v1->vVelocity.x += 2 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 v1->vVelocity.y += 2 * v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 if ( v16->pFacePlane_old.vNormal.z <= 32000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 v22 = 2 * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 v21 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 v40 = 32000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 v1->vVelocity.z += v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 v41 = (unsigned __int64)(v40 * (signed __int64)v21) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 v22 = (unsigned int)(v40 * v21) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 v1->vVelocity.z += v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 if ( v37->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 v17 = -v1->vVelocity.z >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 v1->vVelocity.z = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 if ( (signed __int16)v17 < 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 if ( BYTE3(v16->uAttributes) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 v18 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 v19 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 if ( v19 * v19 + v18 * v18 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 v20 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 v1->vPosition.z = v20[*v16->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 v2 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 v41 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 v40 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 v41 = (unsigned __int64)(58500i64 * v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 v1->vVelocity.x = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 v41 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 v40 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 v1->vVelocity.y = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 v41 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 v28 = __OFSUB__(v38, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 v27 = v38 - 100 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 v1->vVelocity.z = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 if ( !(v27 ^ v28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 if ( v42 <= v1->vPosition.z - 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 if ( !(v5 & 0x40) || _46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 v6 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 v1->vPosition.z = v42 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 v7 = &v6[v38];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 if ( v7->uPolygonType == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 if ( v7->pFacePlane_old.vNormal.z < 45000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 v42 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694 v38 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 v42 = (unsigned __int64)(58500i64 * v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 v1->vVelocity.x = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 v42 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 v42 = (unsigned __int64)(v38 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 v38 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 v1->vVelocity.y = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 v42 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 v42 = (unsigned __int64)(v38 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 v9 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 v1->vVelocity.z = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 if ( v9 * v9 + v1->vVelocity.y * v1->vVelocity.y < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 v1->vVelocity.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 v1->vVelocity.y = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 v1->vVelocity.x = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 memset(&Dst, v8, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 v10 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 if ( v10 & 0x200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 Dst.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 v11 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 v33 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 v31 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 if ( v10 & 0x400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736 Dst.field_20 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 Dst.uTextureID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745 v11 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 v33 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 v31 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 Dst.field_20 = (unsigned __int8)(v11 & 0x80) + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v31, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 pGame->pParticleEngine->AddParticle(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 //----- (00471C03) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 void LayingItem::UpdateObject_fn0_ODM(unsigned int uLayingItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 ObjectDesc *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 signed int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 int v5; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 int v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 __int16 v10; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 int v11; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 int v12; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 signed int v13; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 signed int v14; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 int v16; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 int v17; // ST10_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 signed int v18; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 signed int v19; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 Actor *v20; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 int v21; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 int v22; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 __int16 v23; // bx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 char v24; // al@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 signed int i; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 int v26; // edi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 int v27; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 __int16 v28; // cx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 int v29; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 signed int v30; // edi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 BSPModel *v31; // ecx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 ODMFace *v32; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 int v33; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 int v34; // ecx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 int v35; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 Actor *v36; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 __int16 v37; // ax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 int v38; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 int v39; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 unsigned __int64 v40; // qax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 int v41; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 unsigned __int8 v42; // sf@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 unsigned __int8 v43; // of@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 int v44; // eax@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 __int16 v45; // bx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 int v46; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 const char *v47; // [sp-8h] [bp-B0h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 enum TEXTURE_TYPE v48; // [sp-4h] [bp-ACh]@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 int v49; // [sp+Ch] [bp-9Ch]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 int v50; // [sp+10h] [bp-98h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 Vec3_int_ v51; // [sp+14h] [bp-94h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 Particle_ Dst; // [sp+20h] [bp-88h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 unsigned int uLayingItemID_; // [sp+88h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 int v54; // [sp+8Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 int v55; // [sp+90h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 int v56; // [sp+94h] [bp-14h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819 int v57; // [sp+98h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 int v58; // [sp+9Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 int v59; // [sp+A0h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 Actor *v60; // [sp+A4h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 uLayingItemID_ = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 v1 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 v2 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 v57 = GetTerrainHeightsAroundParty(v1->vPosition.x, v1->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 v3 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 v4 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 v5 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 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
1834 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 v54 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 v8 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 if ( v1->vPosition.z <= v6 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 if ( v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 v9 = v6 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 if ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 v9 = v7 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 v7 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 v58 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 v10 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 if ( !(v10 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 if ( v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 if ( v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 v11 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 v12 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 _46DCC8_get_gravity_direction_outdoor(v12, v11, &v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 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
1869 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 v1->vVelocity.x += (unsigned int)(v56 * v51.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 v1->vVelocity.y += (unsigned int)(v56 * v51.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 v1->vVelocity.z += (unsigned int)(v56 * v51.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 v7 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 if ( v10 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 if ( v1->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 if ( !_46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 if ( !(v2->uFlags & 0x80) || (v21 = -v1->vVelocity.z >> 1, v1->vVelocity.z = v21, (signed __int16)v21 < 10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 v60 = (Actor *)v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 v55 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1891 v60 = (Actor *)((unsigned __int64)(58500i64 * (signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1892 v1->vVelocity.x = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 v60 = (Actor *)v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1894 v60 = (Actor *)((unsigned __int64)(v55 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1895 v55 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 v1->vVelocity.y = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 v60 = (Actor *)v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 v60 = (Actor *)((unsigned __int64)(v55 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 v22 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 v1->vVelocity.z = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 if ( v1->vVelocity.y * v1->vVelocity.y + v22 * v22 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 memset(&Dst, 0, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 v23 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 if ( HIBYTE(v23) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 Dst.uDiffuse = 16727070;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 LABEL_83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 v47 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 if ( HIBYTE(v23) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 Dst.field_20 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 Dst.uTextureID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 LABEL_89:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 pGame->pParticleEngine->AddParticle(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 v47 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944 Dst.field_20 = (unsigned __int8)(v24 & 0x80) + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v47, v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 if ( v1->vPosition.z > v7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 && (v13 = v1->vPosition.x, v13 >= -32768)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 && v13 <= 32768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 && (v14 = v1->vPosition.y, v14 >= -32768)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 && v14 <= 32768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 && v1->vPosition.z <= 13000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 || !(v2->uFlags & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 if ( v1->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 if ( _46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 LABEL_92:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 stru_721530.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 stru_721530.prolly_normal_d = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 stru_721530.field_C = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 stru_721530.field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 stru_721530.field_34.x = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 v15 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 stru_721530.field_34.y = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 stru_721530.normal.y = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 stru_721530.field_34.z = v1->vPosition.z + stru_721530.prolly_normal_d + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 stru_721530.normal.z = stru_721530.field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 stru_721530.field_1C = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 stru_721530.field_20 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 stru_721530.field_24 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 if ( stru_721530._47050A(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 _46E889_collide_against_bmodels(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 v16 = WorldPosToGridCellZ(v1->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 v17 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 v58 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 v18 = WorldPosToGridCellX(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 _46E26D_collide_against_sprites(v18, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 if ( (v1->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 _46EF01_collision_chech_player(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 if ( (v1->field_58 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 v19 = v1->field_58 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 if ( v19 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 if ( v19 < (signed int)(uNumActors - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 v60 = pActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 v20 = &pActors[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 if ( v20->GetActorsRelation(v60) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 _46DF1A_collide_against_actor(v56, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 ++v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 while ( v56 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 v27 = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 stru_721530.normal2.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 stru_721530.normal2.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 v2->uHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 &v49,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 &v50,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 if ( v59 && v26 < v27 + 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 v44 = v27 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 v44 = v54 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 v1->vPosition.x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 v1->vPosition.y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 memset(&Dst, 0, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 v45 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 if ( HIBYTE(v45) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 Dst.uDiffuse = 16727070;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 goto LABEL_83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 if ( HIBYTE(v45) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 v46 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 Dst.uTextureID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 Dst.uDiffuse = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 Dst.field_20 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 v28 = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 v29 = v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 v1->uSectorID = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 if ( v2->uFlags & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 if ( v29 < v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 v1->vPosition.z = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 v30 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 v32 = &v31->pFaces[v30 & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 if ( v32->uPolygonType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 v56 = abs(v32->pFacePlane.vNormal.z * v1->vVelocity.z + v32->pFacePlane.vNormal.y * v1->vVelocity.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 + v32->pFacePlane.vNormal.x * v1->vVelocity.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 if ( stru_721530.field_64 >> 3 > v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 v56 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 v57 = v32->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 v57 = (unsigned __int64)(v56 * (signed __int64)v57) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 v58 = v32->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 v58 = (unsigned __int64)(v56 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 v60 = (Actor *)v32->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 v1->vVelocity.x += 2 * v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 v1->vVelocity.y += 2 * v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 if ( v32->pFacePlane.vNormal.z <= 32000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 v37 = 2 * (short)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 v36 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 v57 = 32000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 v1->vVelocity.z += (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 v58 = (unsigned __int64)(v57 * (signed __int64)(signed int)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2126 v37 = (unsigned int)(v57 * (int)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 v1->vVelocity.z += v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 if ( BYTE3(v32->uFaceAttributes) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 EventProcessor(v32->sCogTriggeredID, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 v34 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136 v1->vPosition.z = v33 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 if ( v1->vVelocity.y * v1->vVelocity.y + v34 * v34 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 LOWORD(v35) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 v58 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 v57 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 v58 = (unsigned __int64)(58500i64 * v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 v1->vVelocity.x = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 v58 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 v57 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 v1->vVelocity.y = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 v58 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 v43 = __OFSUB__(v55, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 v42 = v55 - 100 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 v1->vVelocity.z = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 if ( !(v42 ^ v43) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 v57 = sub_452A9E(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 v38 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 v1->vPosition.x - pLevelDecorations[v30].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 v1->vPosition.y - pLevelDecorations[v30].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 v56 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 v39 = stru_5C6E00->SinCos(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 v60 = (Actor *)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 v40 = v39 * (signed __int64)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 v58 = v40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 v1->vVelocity.x = WORD1(v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 v41 = stru_5C6E00->SinCos(v56 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 v60 = (Actor *)v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 v58 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 v1->vVelocity.y = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 //----- (0047253E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 void __cdecl UpdateObjects()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 unsigned int v0; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 __int16 v3; // dx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 ObjectDesc *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 int v5; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 __int16 v6; // cx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 signed int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 __int16 v8; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 unsigned int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 signed int v11; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 int v12; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 int v14; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 unsigned int v15; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 unsigned int v16; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 unsigned int v17; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 int v18; // [sp+4h] [bp-10h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 int v19; // [sp+8h] [bp-Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 signed int v20; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 v2 = (char *)&pLayingItems[0].uSpriteFrameID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 LOWORD(v0) = *((short *)v2 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 if ( v0 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 v0 &= 0xFFFFFFBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 *((short *)v2 - 2) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228 v3 = *((short *)v2 - 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229 v4 = &pObjectList->pObjects[*((short *)v2 - 14)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 if ( (v0 & 0x80u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 v5 = *(int *)(v2 + 62) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 *(int *)(v2 - 26) = pActors[v5].vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 *(int *)(v2 - 22) = pActors[v5].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 *(int *)(v2 - 18) = pActors[v5].vPosition.z + pActors[v5].uActorHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 if ( !v3 || (v6 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2, *(short *)v2 = v6, !(v4->uFlags & 4)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 if ( v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 v7 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 v7 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 if ( v6 < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 v8 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 *(short *)v2 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 v9 = v4->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 if ( !(v9 & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 if ( v8 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 LayingItem::_42F933(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 v11 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 v11 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 if ( v8 < v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 LayingItem::UpdateObject_fn0_BLV(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 LayingItem::UpdateObject_fn0_ODM(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 if ( pParty->bTurnBasedModeOn != 1 || !(*(v2 - 4) & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 v12 = abs(pParty->vPosition.x - *(int *)(v2 - 26));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 v18 = abs(pParty->vPosition.z - *(int *)(v2 - 22));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276 v19 = abs(pParty->vPosition.y - *(int *)(v2 - 18));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 v14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 v15 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 if ( v12 < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 v13 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 v14 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 if ( v13 < v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 v16 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 v13 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 if ( v14 < (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 v17 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 v14 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 v0 = (unsigned int)(11 * v14) >> 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 if ( (signed int)(v0 + (v15 >> 2) + v13) <= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 v10 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 if ( !(v9 & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 _46BFFA_check_object_intercept(v1, 8 * v1 | OBJECT_Item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 v2 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2312 v1 = v20++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2313 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314 while ( v20 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318 //----- (0047272C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2319 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
2320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 signed int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2323 int v7; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2324 signed int v8; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326 v5 = x - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 v7 = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2328 v8 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2329 *pSectorID = pIndoor->GetSector(x - 2, y, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2330 result = _46ED1B_collide_against_floor(v5, v8, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2331 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2333 *pSectorID = pIndoor->GetSector(v7 + 2, v8, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2334 result = _46ED1B_collide_against_floor(v7 + 2, v8, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2335 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2337 *pSectorID = pIndoor->GetSector(v7, v8 - 2, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2338 result = _46ED1B_collide_against_floor(v7, v8 - 2, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2339 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 *pSectorID = pIndoor->GetSector(v7, v8 + 2, z + 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 result = _46ED1B_collide_against_floor(v7, v8 + 2, z + 40, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 *pSectorID = pIndoor->GetSector(v7, v8, z + 140);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 result = _46ED1B_collide_against_floor(v7, v8, z + 140, pSectorID, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354 //----- (00472866) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 void __cdecl BLV_ProcessPartyActions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 float v4; // ST40_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 Player **v5; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 int v6; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 Player **v7; // esi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 signed __int64 v8; // qax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 int v9; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 double v10; // st7@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 BLVFace *v11; // edx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 unsigned int v12; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 double v13; // st7@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 int v14; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 signed __int64 v15; // qax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 double v16; // st7@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 int v17; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 double v18; // st7@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2376 int v19; // ST40_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 int v20; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 double v21; // st7@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 int v22; // ST40_4@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2380 int v23; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 double v24; // st7@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 int v25; // ST40_4@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 int v26; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 double v27; // st7@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 int v28; // ST40_4@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 int v29; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387 double v30; // st7@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 int v31; // ST3C_4@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 int v32; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390 double v33; // st7@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 int v34; // ST3C_4@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 unsigned int v35; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 int v36; // ecx@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 int v37; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 int v38; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 int v39; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 int v40; // eax@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 Player **v41; // esi@113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 int v42; // eax@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 signed int v43; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 BLVFace *v44; // esi@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 PolygonType v45; // al@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 int v46; // ecx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 char v47; // zf@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 int v48; // eax@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 int v49; // ST40_4@136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 int v50; // ST40_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2408 int v51; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 int v52; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 signed int v53; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 int v54; // ebx@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2412 int v55; // ST30_4@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2413 AudioPlayer *v56; // ecx@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2414 SoundID v57; // [sp-20h] [bp-80h]@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 signed int v58; // [sp-1Ch] [bp-7Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2416 unsigned int v59; // [sp-18h] [bp-78h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2417 signed int v60; // [sp-14h] [bp-74h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2418 signed int v61; // [sp-10h] [bp-70h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 int v62; // [sp-Ch] [bp-6Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2420 int v63; // [sp-8h] [bp-68h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2421 unsigned int v64; // [sp-8h] [bp-68h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2422 int v65; // [sp-4h] [bp-64h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2423 int v66; // [sp-4h] [bp-64h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2424 double v67; // [sp+Ch] [bp-54h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 int v68; // [sp+10h] [bp-50h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2426 int v69; // [sp+10h] [bp-50h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2427 int v70; // [sp+14h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2428 signed int v71; // [sp+18h] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 signed int v72; // [sp+1Ch] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 signed int v73; // [sp+20h] [bp-40h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2431 int v74; // [sp+20h] [bp-40h]@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 signed int bFeatherFall; // [sp+24h] [bp-3Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2433 bool bFeatherFalla; // [sp+24h] [bp-3Ch]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2434 unsigned int v77; // [sp+28h] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2435 int v78; // [sp+2Ch] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2436 int v79; // [sp+30h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2437 int i; // [sp+34h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2438 int v81; // [sp+38h] [bp-28h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 int v82; // [sp+3Ch] [bp-24h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2440 int v83; // [sp+40h] [bp-20h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 int bJumping; // [sp+44h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 int v85; // [sp+48h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2443 int v86; // [sp+4Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2444 int v87; // [sp+50h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2445 float v88; // [sp+54h] [bp-Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 int v89; // [sp+58h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2447 int angle; // [sp+5Ch] [bp-4h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2448
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2449 v0 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2450 v89 = pParty->uFallSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2451 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2452 v85 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2453 v70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2454 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2455 v86 = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 v87 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2457 v77 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2458 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2461 bJumping = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2462 v3 = v0 + 40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2463 i = _46ED1B_collide_against_floor(v86, v85, v3, &v77, &v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2464 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2466 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2467 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2468 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2470 if ( i == -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2472 i = _47272C_collide_agains_some_secotors_floors(v86, v85, v3, &v77, &v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2473 if ( i == -30000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2475 pParty->vPosition.x = blv_prev_party_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2476 pParty->vPosition.z = blv_prev_party_z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2477 pParty->vPosition.y = blv_prev_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2478 pParty->uFallStartY = blv_prev_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2479 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2482 blv_prev_party_x = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2483 blv_prev_party_z = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2484 blv_prev_party_y = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2485 if ( pParty->bTurnBasedModeOn != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2487 v4 = (double)(GetTickCount() / 0x1F4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2488 v67 = v4 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2489 if ( *(int *)&word_720C10_intercepts_xs[102] != LODWORD(v67) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2491 dword_4F8584[3 * dword_4F8580[0]] = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2492 dword_4F8588[3 * dword_4F8580[0]] = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2493 dword_4F8580[3 * dword_4F8580[0]++ + 3] = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2494 if ( dword_4F8580[0] > 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2495 dword_4F8580[0] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 *(int *)&word_720C10_intercepts_xs[102] = LODWORD(v67);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 if ( SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2500 || SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 && LODWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2502 bFeatherFall = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2503 v5 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2504 while ( !(*v5)->WearsItem(536, 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2506 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2507 if ( (signed int)v5 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2509 v6 = pParty->uFallStartY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2510 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2513 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2514 v6 = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2515 bFeatherFall = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2516 pParty->uFallStartY = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2517 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2518 if ( v6 - v87 > 512 && !bFeatherFall && v87 <= i + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2520 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2521 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2522 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2526 v7 = &pPlayers[1]; // receive falling damage
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2529 if ( !(*v7)->HasEnchantedItemEquipped(72) && !(*v7)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 v8 = (signed __int64)((double)(*v7)->GetMaxHealth() * 0.1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2532 (*v7)->ReceiveDamage((pParty->uFallStartY - v87) * (signed int)v8 / 256, 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2533 v9 = (*v7)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2534 v10 = (double)(20 - (*v7)->_48EA1B_get_static_effect(v9)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2535 (*v7)->SetRecoveryTime((signed __int64)v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2537 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2539 while ( (signed int)v7 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2542 if ( v87 > i + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2543 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 bFeatherFalla = v87 - i <= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2545 if ( v87 - i <= 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2546 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2547 if ( bWalkSound && pParty->field_6F8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2548 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2549 if ( v87 > i + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2551 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2554 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 v87 = i + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2557 pParty->uFallStartY = i + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2559 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2560 if ( pParty->field_6F4_packedid != v79 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2562 v11 = &pIndoor->pFaces[v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 if ( BYTE3(v11->uAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 v70 = pIndoor->pFaceExtras[v11->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569 LABEL_44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 pParty->field_6F4_packedid = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2571 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 v68 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573 if ( pIndoor->pFaces[v79].uAttributes & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 v71 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 v81 = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 angle = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 v83 = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2578 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 / 180)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2586 case PARTY_TurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2589 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2590 v13 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2592 case PARTY_TurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2593 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2594 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2595 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 v16 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 case PARTY_FastTurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2600 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2603 v14 = angle + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2607 v13 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2609 v14 = angle + (unsigned __int64)(signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 angle = stru_5C6E00->uDoublePiMask & v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2613 case PARTY_FastTurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2617 v16 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2619 v15 = (signed __int64)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 angle = stru_5C6E00->uDoublePiMask & (angle - v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2623 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 case PARTY_StrafeLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 v17 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2626 v18 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2627 v88 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2629 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 v19 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v88 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2632 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2633 case PARTY_StrafeRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2635 v21 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 v88 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2637 v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2638 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 v22 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v88 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2641 goto LABEL_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 case PARTY_WalkForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2643 v23 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 v24 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645 v88 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2647 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2648 v25 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2649 v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v88 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2650 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2651 v1 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2652 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2653 case PARTY_WalkBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2654 v26 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2655 v27 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2656 v88 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2657 v78 = (unsigned __int64)(v26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2658 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2659 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2660 v28 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2661 v78 = (unsigned __int64)(v28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2662 * (signed __int64)(signed int)(signed __int64)(v88 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2663 LABEL_68:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2664 v1 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2665 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2666 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2667 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2668 case PARTY_RunForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2669 v29 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2670 v30 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 v88 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 v2 += (unsigned __int64)(v29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2673 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2674 * (unsigned __int64)(signed __int64)(v30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2675 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2676 v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 v1 += (unsigned __int64)(v31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2678 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2679 * (unsigned __int64)(signed __int64)(v88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2680 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2681 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 case PARTY_RunBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 v32 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2684 v33 = (double)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2685 v88 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2686 v2 -= (unsigned __int64)(v32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2687 * (signed __int64)(signed int)(signed __int64)(v33 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689 v1 -= (unsigned __int64)(v34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 * (signed __int64)(signed int)(signed __int64)(v88 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2692 v72 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2693 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 case PARTY_LookUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695 v83 += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2696 if ( v83 > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2697 v83 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2698 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2699 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2702 v63 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2703 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704 case PARTY_LookDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 v83 += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 if ( v83 < -128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 v83 = -128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2709 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 v63 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 pPlayers[v35]->PlaySound(v63, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 case PARTY_CenterView:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 case PARTY_Jump:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 if ( (!bJumping || v87 <= i + 6 && v89 <= 0) && pParty->field_24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 v89 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 pParty->sRotationY = angle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 pParty->sRotationX = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 v89 += -2 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 if ( pIndoor->pFaces[v68].pFacePlane_old.vNormal.z < 32768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 v89 -= pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2747 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 if ( bJumping != v36 && v89 <= v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 if ( v89 < -500 && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 v41 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2757 (*v41)->PlayEmotion(46, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2758 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2762 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2764 LABEL_92:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2765 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2767 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2770 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2773 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2775 stru_721530.field_8 = pParty->field_14 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2778 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2779 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 v37 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 stru_721530.field_34.x = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 stru_721530.normal.x = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2784 stru_721530.field_1C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2785 stru_721530.field_34.y = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 stru_721530.normal.y = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 stru_721530.field_20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2788 stru_721530.normal.z = stru_721530.prolly_normal_d + v87 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 stru_721530.field_34.z = stru_721530.field_C + v87 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 stru_721530.field_24 = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2791 stru_721530.uSectorID = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2793 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2794 v38 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2795 if ( stru_721530._47050A(v38) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2796 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2797 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2798 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2800 _46E44E_collide_against_faces_and_portals(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2801 _46E0B2_collide_against_decorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2802 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2803 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2804 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2808 while ( v73 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2809 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811 v39 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2812 v77 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2813 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 v39 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16) + v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2818 v77 = v85 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2819 v40 = v37 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 v42 = _46ED1B_collide_against_floor(v39, v77, v40 + 40, &stru_721530.uSectorID, &v79);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2822 if ( v42 == -30000 || v42 - v37 > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2823 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2824 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2826 v86 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2827 v85 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 v37 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831 v86 += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2832 v85 += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2833 v43 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 v77 = stru_721530.uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2836 v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2839 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2842 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2847 v53 = sub_452A9E(v2 * v2 + v1 * v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 i = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 v54 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2850 v86 - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 v85 - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 v2 = (unsigned __int64)(stru_5C6E00->SinCos(v54) * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 v1 = (unsigned __int64)(v55 * (signed __int64)i) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2857 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2858 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2860 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 v45 = v44->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2862 if ( v45 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2864 if ( v89 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2865 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2866 v87 = pIndoor->pVertices[*v44->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2867 if ( pParty->uFallStartY - v87 < 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2868 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2869 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2872 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2873 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874 goto LABEL_143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2876 v46 = v89 * v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 v47 = v45 == 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2878 v48 = v44->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2881 i = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2882 if ( stru_721530.field_64 >> 3 > i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2883 i = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 v50 = (unsigned __int64)(i * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 v81 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2886 v81 = (unsigned __int64)(i * (signed __int64)v81) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2887 v82 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2888 v82 = (unsigned __int64)(i * (signed __int64)v82) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2889 v2 += v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2891 v74 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2892 v51 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2893 v69 = v44->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2894 i = v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2895 v1 += v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2896 v52 = stru_721530.prolly_normal_d - ((v44->pFacePlane_old.dist + v87 * v74 + v85 * v51 + v86 * v69) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2897 if ( v52 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2899 v86 += v52 * v69 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 v85 += v52 * i >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 v87 += v52 * v74 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 LABEL_142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 v43 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 LABEL_143:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907 v70 = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 i = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2911 if ( stru_721530.field_64 >> 3 > i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 i = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 v49 = (unsigned __int64)(i * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 v81 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 v81 = (unsigned __int64)(i * (signed __int64)v81) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 v82 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2917 v82 = (unsigned __int64)(i * (signed __int64)v82) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2918 v2 += v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2919 v1 += v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2920 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2921 if ( v2 * v2 + v1 * v1 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2922 goto LABEL_142;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2923 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2924 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2925 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2928 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 v1 = (unsigned __int64)(58500i64 * v1) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 ++v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 v89 = (unsigned __int64)(58500i64 * v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 if ( v83 >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 v37 = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 if ( sub_452A9E((pParty->vPosition.x - v86) * (pParty->vPosition.x - v86) + (pParty->vPosition.z - v85)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2942 * (pParty->vPosition.z - v85)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2943 + (pParty->vPosition.y - v37)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2944 * (pParty->vPosition.y - v37)) <= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2945 goto LABEL_188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 if ( v72 && (!bJumping || bFeatherFalla) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2951 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 if ( !v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 if ( BYTE2(pIndoor->pFaces[v79].uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959 v57 = (SoundID)50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2960 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961 v57 = (SoundID)64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 v57 = (SoundID)63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2966 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 if ( v78 && (!bJumping || bFeatherFalla) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2974 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 if ( v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2980 v57 = (SoundID)102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2981 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2983 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 if ( BYTE2(pIndoor->pFaces[v79].uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2985 v57 = (SoundID)89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2986 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2987 v57 = (SoundID)103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988 LABEL_175:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2989 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2991 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 LABEL_188:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 if ( !bJumping || bFeatherFalla )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 BYTE1(pParty->uFlags) &= 0xFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 pParty->vPosition.x = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 pParty->vPosition.y = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3005 pParty->vPosition.z = v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3006 pParty->uFallSpeed = v89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3007 if ( !bJumping && BYTE3(pIndoor->pFaces[v79].uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3008 BYTE1(pParty->uFlags) |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 if ( v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 EventProcessor(v70, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014 //----- (00473893) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 void __cdecl ODM_ProcessPartyActions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 int _zero; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 int v3; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 Player **v4; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 int v5; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 int v6; // esi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 ODMFace *v7; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 unsigned int v8; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 double v9; // st7@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 signed __int64 v10; // qax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 double v11; // st7@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 int v12; // ecx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 int v13; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 double v14; // st7@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 int v15; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 double v16; // st7@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 int v17; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 double v18; // st7@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 int v19; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 double v20; // st7@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 int v21; // eax@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 double v22; // st7@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 int v23; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 double v24; // st7@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 int v25; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 double v26; // st7@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 int v27; // eax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 double v28; // st7@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 signed __int64 v29; // qax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 unsigned int v30; // eax@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 int v31; // eax@130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 int v32; // ecx@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 signed int v33; // eax@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 int v34; // esi@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 unsigned int v35; // esi@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 int v36; // eax@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 signed int v37; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 signed int v38; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 signed int i; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 int v40; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 Player **v41; // esi@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 bool v42; // eax@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 signed int v43; // ecx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 signed int v44; // edx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 int v45; // ecx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 BSPModel *v46; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 ODMFace *v47; // esi@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 int v48; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 char v49; // zf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 char v50; // sf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 unsigned __int8 v51; // of@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 int v52; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070 unsigned __int8 v53; // dl@205
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071 BSPModel *v54; // eax@215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072 int v55; // eax@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073 signed int v56; // ebx@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 int v57; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 BSPModel *v58; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 unsigned __int64 v59; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 BSPModel *v60; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078 unsigned __int64 v61; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 int v62; // eax@241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 signed int v63; // ST04_4@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 signed int v64; // eax@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 unsigned int v65; // ebx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 unsigned int v66; // esi@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 int v67; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 signed int v68; // ecx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 int v69; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 int v70; // ebx@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 int v71; // esi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 int v72; // edi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 int v73; // eax@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 Player **v74; // esi@283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 int v75; // eax@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 unsigned int v76; // edi@293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 bool v77; // edx@297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 bool v78; // ecx@303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 int v79; // ecx@314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 __int16 v80; // dx@317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098 int v81; // ebx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 int v82; // ecx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 int v83; // eax@321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 Player **v84; // esi@333
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 int v85; // eax@334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 int v86; // [sp-20h] [bp-B4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 int v87; // [sp-20h] [bp-B4h]@248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 signed int v88; // [sp-1Ch] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106 unsigned int v89; // [sp-18h] [bp-ACh]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 signed int v90; // [sp-14h] [bp-A8h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 signed int v91; // [sp-10h] [bp-A4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 int v92; // [sp-Ch] [bp-A0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 int v93; // [sp-8h] [bp-9Ch]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 unsigned int v94; // [sp-8h] [bp-9Ch]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 int v95; // [sp-4h] [bp-98h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 int v96; // [sp-4h] [bp-98h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 int v97; // [sp+Ch] [bp-88h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 int v98; // [sp+10h] [bp-84h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 int v99; // [sp+14h] [bp-80h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 int v100; // [sp+18h] [bp-7Ch]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 bool v101; // [sp+1Ch] [bp-78h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 int v102; // [sp+20h] [bp-74h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 int v103; // [sp+24h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 int bFeatherFall; // [sp+28h] [bp-6Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 int v105; // [sp+2Ch] [bp-68h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 int bWaterWalk; // [sp+30h] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124 bool v107; // [sp+34h] [bp-60h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 int v108; // [sp+38h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3126 int v109; // [sp+3Ch] [bp-58h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 int v110; // [sp+40h] [bp-54h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 int v111; // [sp+44h] [bp-50h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 int bJumping; // [sp+48h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130 int v113; // [sp+4Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 unsigned int v114; // [sp+50h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3132 int _walk_speed; // [sp+54h] [bp-40h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3133 int v116; // [sp+58h] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 int v117; // [sp+5Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3135 int v118; // [sp+60h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3136 Player **v119; // [sp+64h] [bp-30h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 int _angle_x; // [sp+68h] [bp-2Ch]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3138 int v121; // [sp+6Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3139 unsigned int v122; // [sp+70h] [bp-24h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 int v123; // [sp+74h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 int v124; // [sp+78h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3142 int _angle_y; // [sp+7Ch] [bp-18h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 int v126; // [sp+80h] [bp-14h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 BSPModel *v127; // [sp+84h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3145 int v128; // [sp+88h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146 int v129; // [sp+8Ch] [bp-8h]@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 int v130; // [sp+90h] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3149 v121 = pParty->uFallSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 v123 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3151 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3152 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 v103 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 v116 = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 v117 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3158 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 bJumping = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 v118 = GetTerrainHeightsAroundParty(pParty->vPosition.x, pParty->vPosition.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3161 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3163 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3164 v102 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3166 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3167 if ( SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 || SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 && LODWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 bFeatherFall = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 v119 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3172 while ( !(*v119)->WearsItem(536, 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 if ( (signed int)v119 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 bFeatherFall = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 if ( (signed __int64)pParty->pPartyBuffs[18].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 bWaterWalk = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 if ( !(pParty->pPartyBuffs[18].uFlags & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 && *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[18].uCaster + 10] <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 v3 = sub_46D49E_prolly_get_world_y_under_party(v116, v117, v123, pParty->uPartyHeight, &v130, &v108, bWaterWalk);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 v111 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3196 if ( bFeatherFall )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 pParty->uFallStartY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3198 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3199 v3 = pParty->uFallStartY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 if ( v3 - v123 > 512 && !bFeatherFall && v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3202 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3204 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 v4 = &pPlayers[1]; // receive falling damage
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211 if ( !(*v4)->HasEnchantedItemEquipped(72) && !(*v4)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 v105 = (*v4)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 (*v4)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 (signed int)((pParty->uFallStartY - v123) * (unsigned __int64)(signed __int64)((double)v105 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3216 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 v5 = (*v4)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 v105 = 20 - (*v4)->_48EA1B_get_static_effect(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3219 (*v4)->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 while ( (signed int)v4 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 if ( pParty->bFlying != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 v109 = sub_46D8E3(v116, v117, v123 + pParty->uPartyHeight, (int)&v102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 v107 = v108 == _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 v105 = v111 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 if ( v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 v101 = v123 - v111 <= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 if ( bWalkSound != _zero && pParty->field_6F8 > _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 if ( !bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < _zero || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 if ( bJumping == _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 if ( pParty->field_6F4_packedid != (8 * v108 | OBJECT_BModel) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 if ( v108 != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 if ( v108 >> 6 < pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 v7 = (ODMFace *)&pOutdoor->pBModels[v108 >> 6].pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 v6 = v108 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 if ( *(char *)(v7->pFacePlane.vNormal.x + 308 * v6 + 31) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 _walk_speed = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 _angle_y = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 _angle_x = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3271 v126 = pEventTimer->dt_in_some_format;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 v119 = (Player **)((unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 / 180)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 LABEL_118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 case PARTY_FlyUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 if ( pParty->vPosition.y < 4000 || bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3291 v123 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 v113 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 if ( v123 > 4000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 v123 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 v113 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 if ( v102 && v123 < v109 && (signed int)(pParty->uPartyHeight + v123) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 pParty->field_6E0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 pParty->field_6E4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 BYTE1(pParty->uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 pParty->vPosition.y = v109 - pParty->uPartyHeight - 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 pParty->field_6F0 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 v123 = v109 - pParty->uPartyHeight - 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 v127 = (BSPModel *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 case PARTY_FlyDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 v123 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 v113 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 v127 = (BSPModel *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 if ( v123 <= v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 case PARTY_TurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 v9 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 case PARTY_TurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 goto LABEL_77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 v11 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 case PARTY_FastTurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 v12 = v8 + _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 _angle_y = stru_5C6E00->uDoublePiMask & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 v9 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 _angle_y = stru_5C6E00->uDoublePiMask & (_angle_y + (unsigned __int64)(signed __int64)v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 case PARTY_FastTurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 v11 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 v10 = (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 LABEL_77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 v12 = _angle_y - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 case PARTY_StrafeLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 v13 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384 v14 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 v126 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 *(float *)&v128 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 v124 = (unsigned __int64)(v13 * (signed __int64)((signed int)(signed __int64)(v14 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 v126 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 * (signed __int64)((signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 case PARTY_StrafeRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 v15 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 v16 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 v126 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 *(float *)&v128 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 v124 = (unsigned __int64)(v15 * (signed __int64)((signed int)(signed __int64)(v16 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 v126 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 * (signed __int64)((signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403 goto LABEL_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 case PARTY_WalkForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3405 v17 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 v18 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 v126 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 *(float *)&v128 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 v124 = (unsigned __int64)(v17 * (signed __int64)(signed int)(signed __int64)(v18 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3410 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 v1 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 case PARTY_WalkBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 v19 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 v20 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 v126 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 *(float *)&v128 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 v124 = (unsigned __int64)(v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 * (signed __int64)(signed int)(signed __int64)(v20 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 LABEL_90:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 v1 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 case PARTY_RunForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 v21 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436 v22 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 v126 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 *(float *)&v128 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 v129 = (unsigned __int64)(v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 * (unsigned __int64)(signed __int64)(v22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 if ( v118 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454 v23 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 v24 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 v126 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 *(float *)&v128 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 v129 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 v25 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 v26 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 v114 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 *(float *)&v128 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 v129 = (unsigned __int64)(v25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3471 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 * (unsigned __int64)(signed __int64)(v26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3474 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 v114 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 v129 = (unsigned __int64)((signed int)v114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3480 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 case PARTY_RunBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 v27 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 v28 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 v126 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 *(float *)&v128 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 v29 = (signed __int64)(v28 * fBackwardMovementSlowdownMultiplier);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3492 v129 = (unsigned __int64)(v126 * (signed __int64)(4 * (signed int)v29)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 * fBackwardMovementSlowdownMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 v129 = (unsigned __int64)(v126 * (signed __int64)(signed int)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 * fBackwardMovementSlowdownMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 v124 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 case PARTY_LookUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 if ( _angle_x > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 _angle_x = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 v93 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 goto _play_player_sound;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 case PARTY_LookDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 if ( _angle_x < -128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 _angle_x = -128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 v93 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 _play_player_sound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 pPlayers[v30]->PlaySound(v93, v95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 case PARTY_CenterView:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 _angle_x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 case PARTY_Jump:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 if ( (!v118 || v108) && !bJumping && pParty->field_24 && !(pParty->uFlags & 4) && !(BYTE1(pParty->uFlags) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 v126 = pParty->field_24 << 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 v121 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v121);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 case PARTY_Land:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 BYTE1(pParty->uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 LABEL_123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 pParty->sRotationY = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 pParty->sRotationX = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 if ( v123 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 LABEL_130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 v31 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 v126 = stru_5C6E00->SinCos(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 v129 = (unsigned __int64)(4i64 * v126) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 v123 = v113 + v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 v123 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 goto LABEL_141;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 if ( v130 && v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 sub_42F960_create_object(v116, v117, v111);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 pParty->uFallStartY = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 v113 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 LABEL_141:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 if ( bJumping && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength());
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 v34 = v121 + 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 v121 += 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3603 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 if ( !v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 v34 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 LABEL_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 if ( bJumping == v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 goto LABEL_164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 if ( !bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 if ( v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618 _46DCC8_get_gravity_direction_outdoor(v116, v117, (Vec3_int_ *)&v98);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619 v35 = v121 + -8 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3620 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
3621 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3622 v2 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v99) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624 v1 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v100) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627 v34 = (int)((char *)v127 + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 v121 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 v34 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3633 LABEL_164:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634 if ( !bUnderwater && v34 <= v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636 if ( v34 < -500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 && !pParty->bFlying
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 && pParty->vPosition.y - v111 > 1000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3639 && SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 && (SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 || !LODWORD(pParty->pPartyBuffs[5].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 v41 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3645 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) && (*v41)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3646 (*v41)->PlaySound(66, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 LABEL_150:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 if ( v2 * v2 + v1 * v1 < 400 && !v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3662 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 stru_721530.field_8 = pParty->field_14 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 v126 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3668 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 stru_721530.field_34.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 stru_721530.normal.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 stru_721530.field_1C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 stru_721530.field_34.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 stru_721530.normal.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 stru_721530.normal.z = stru_721530.prolly_normal_d + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 stru_721530.field_34.z = stru_721530.field_C + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 stru_721530.field_20 = v128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678 stru_721530.field_24 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3680 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 v36 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3683 if ( stru_721530._47050A(v36) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3684 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 _46E889_collide_against_bmodels(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3686 v37 = WorldPosToGridCellZ(pParty->vPosition.z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3687 v38 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 _46E26D_collide_against_sprites(v38, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3689 _46ED8A_collide_against_layingItems(4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3690 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 _angle_x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3695 _angle_y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3696 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3698 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 _angle_x = v116 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 _angle_y = v117 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 v127 = (BSPModel *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 v40 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 v122 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 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
3707 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
3708 v119 = (Player **)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3709 v116,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3712 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714 &v110,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 v127 = (BSPModel *)GetTerrainHeightsAroundParty(_angle_x, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717 v42 = GetTerrainHeightsAroundParty(v116, _angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 v118 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 if ( !v97 && !v110 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 v107 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 if ( bUnderwater || !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 if ( v127 && v129 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 if ( v118 && (signed int)v119 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 if ( v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 if ( v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 goto LABEL_198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 v127 = (BSPModel *)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 _angle_x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 &v108,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 if ( GetTerrainHeightsAroundParty(_angle_x, _angle_y) && (signed int)v127 <= v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 goto LABEL_199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 LABEL_198:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 LABEL_199:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 v116 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 v117 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 v123 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 v123 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3778 v56 = sub_452A9E(v2 * v2 + v128 * v128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 v118 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 v57 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 _angle_y - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 v129 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 v58 = (BSPModel *)stru_5C6E00->SinCos(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 v127 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 v59 = (signed int)v58 * (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 v122 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 v2 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 v60 = (BSPModel *)stru_5C6E00->SinCos(v129 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 v127 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 v61 = (signed int)v60 * (signed __int64)v118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 v122 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 v128 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 v127 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 v48 = v47->pBoundingBox.z2 - v47->pBoundingBox.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 v51 = __OFSUB__(v48, 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 v49 = v48 == 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 v50 = v48 - 32 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 v52 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 v129 = (unsigned __int8)(v50 ^ v51 | v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 v119 = (Player **)(v52 < 46378);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3811 v119 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3812 v53 = v47->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3813 if ( v53 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3815 if ( v121 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3816 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3817 v123 = v127->pVertices.pVertices[v47->pVertexIDs[0]].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3818 if ( v2 * v2 + v128 * v128 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3819 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 goto LABEL_221;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3825 if ( !v129 && (v53 != 4 || v119) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3828 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 v129 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 _walk_speed = v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 _walk_speed = (unsigned __int64)(v118 * (signed __int64)_walk_speed) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3835 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 v127 = (BSPModel *)v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 v54 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3841 v121 += (int)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 v128 += _walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3844 v55 = stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845 - ((signed int)(v47->pFacePlane.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846 + v122 * v47->pFacePlane.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847 + _angle_y * v47->pFacePlane.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 + _angle_x * v47->pFacePlane.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 if ( v55 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 v116 = _angle_x + (v47->pFacePlane.vNormal.x * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 v117 = _angle_y + (v47->pFacePlane.vNormal.y * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 v123 = v122 + (v47->pFacePlane.vNormal.z * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3856 LABEL_220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3857 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3858 LABEL_221:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3859 if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uFaceAttributes) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3861 pParty->field_6F4_packedid = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 v103 = v47->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 v122 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 v122 = (unsigned __int64)(v118 * (signed __int64)(signed int)v122) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 v127 = (BSPModel *)v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3873 v129 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3874 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 v121 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 v2 += v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 v128 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 if ( v2 * v2 + v128 * v128 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3879 goto LABEL_220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3880 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3881 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3886 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 v127 = (BSPModel *)58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 v122 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 ++v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 v121 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 while ( v126 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 v122 = abs(pParty->vPosition.x - v116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 v126 = abs(pParty->vPosition.z - v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3898 v62 = abs(pParty->vPosition.y - v123);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3899 if ( sub_452A9E(v122 * v122 + v126 * v126 + v62 * v62) < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 goto LABEL_344;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3901 if ( v114 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 if ( !v107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 && !(BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3907 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3909 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3910 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3913 v87 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3916 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 v86 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 LABEL_255:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 v63 = WorldPosToGridCellZ(pParty->vPosition.z) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3926 v64 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 v87 = pOutdoor->_47EE49(v64, v63, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 if ( v124 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 if ( v107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 || BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uFaceAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 goto LABEL_255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3950 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 v87 = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 LABEL_257:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 pAudioPlayer->PlaySound((SoundID)v87, v88, v89, v90, v91, v92, v94, v96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 LABEL_344:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 if ( !bJumping || v101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3964 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3965 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 v126 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 v65 = WorldPosToGridCellZ(pParty->vPosition.z) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3969 v114 = WorldPosToGridCellX(v116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3970 v66 = WorldPosToGridCellZ(v117) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3971 v127 = (BSPModel *)(((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 v122 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v114, v65) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 v67 = pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3975 v69 = ((unsigned int)~v67 >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3976 if ( v114 == v126 && v66 == v65 && v122 && v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3977 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 if ( v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3982 v70 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 v71 = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 v72 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 v73 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 pParty->vPosition.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3988 pParty->vPosition.z = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3989 pParty->vPosition.y = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3990 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 v73 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 pParty->uFallStartY = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 pParty->vPosition.y = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v71)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 && pParty->vPosition.z == v72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4000 && (v73 = pParty->vPosition.y, pParty->vPosition.y == v70) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4001 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 if ( v73 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4005 v73 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 pParty->vPosition.y = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4007 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4011 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 v74 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 v110 = (*v74)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 (*v74)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4020 (signed int)((pParty->uFallStartY - v70) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 v75 = (*v74)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 v110 = 20 - (*v74)->_48EA1B_get_static_effect(v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 (*v74)->SetRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 (signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 while ( (signed int)v74 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 v73 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 pParty->uFallStartY = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034 if ( v102 && v73 < v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 if ( (signed int)(pParty->uPartyHeight + v73) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 pParty->vPosition.y = v109 - pParty->uPartyHeight - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4039 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 v76 = pParty->bFlying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 if ( pParty->bFlying || v101 == 0 || bWaterWalk || !v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 v77 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4049 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 v77 = v122 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 if ( !pParty->bFlying && v101 != 0 && !bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 v78 = v69 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 goto LABEL_306;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 LABEL_306:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 if ( v77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 pParty->vPosition.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 goto LABEL_313;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 goto LABEL_312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 if ( v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 LABEL_312:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 pParty->vPosition.z = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4074 LABEL_313:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 if ( bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4078 v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4079 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4080 if ( !v122 || !v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4082 if ( !v76 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 v80 = *(short *)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 LOBYTE(pParty->uFlags) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 *(short *)v79 = v80 & 0xFFFE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4090 goto LABEL_318;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4094 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4095 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4096 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 LABEL_318:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 v81 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 v82 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4100 pParty->vPosition.y = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4101 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4103 v82 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 pParty->uFallStartY = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 pParty->vPosition.y = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4108 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4109 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4110 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 v83 = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.z, &v110, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4113 v82 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4114 if ( pParty->vPosition.y <= v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4115 pParty->uFlags |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4118 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v116)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4119 && pParty->vPosition.z == v117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4120 && (v82 = pParty->vPosition.y, pParty->vPosition.y == v81) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 if ( v82 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4124 v82 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4126 pParty->vPosition.y = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4127 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4131 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 v84 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138 v110 = (*v84)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139 (*v84)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140 (signed int)((pParty->uFallStartY - v81) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142 v85 = (*v84)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4143 v110 = 20 - (*v84)->_48EA1B_get_static_effect(v85);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144 (*v84)->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 while ( (signed int)v84 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 v82 = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 pParty->uFallStartY = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 if ( v102 && v82 < v109 && (signed int)(pParty->uPartyHeight + v82) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 pParty->vPosition.y = v82 + pParty->uPartyHeight - v109 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4156 pParty->field_6F0 = v82 + pParty->uPartyHeight - v109 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165 //----- (0047531C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 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
4167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4168 BLVFace *v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 int v11; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 int v12; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 int v13; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4172 int v14; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4173 signed __int64 v15; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4174 __int16 v16; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4175 int *v18; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4176 int v19; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4177 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4178 int a9b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4179 int a9a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4180 int a10b; // [sp+3Ch] [bp+24h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4181 signed int a10a; // [sp+3Ch] [bp+24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4182 int a10c; // [sp+3Ch] [bp+24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4183
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4184 v10 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 v19 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 if ( a10 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 v11 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 a10b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 a9b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 v12 = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 a9a = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 v13 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 - a5 * v10->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 - v10->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4201 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 - a5 * v10->pFacePlane_old.vNormal.z - v10->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4204 a10c = abs(v13) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4205 if ( a10c > abs(v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 LODWORD(v15) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 HIDWORD(v15) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4209 v14 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210 a10a = v15 / a9a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4212 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4213 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 a10a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 v14 = abs(v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 v16 = a4 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4218 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4219 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4220 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 HIWORD(a7a) = v16 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 if ( !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 v10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229 *v18 = a10a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 if ( a10a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 *v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235 //----- (004754BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 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
4237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4238 BLVFace *v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 int v12; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 int v13; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 int v14; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 int v15; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 signed __int64 v16; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 __int16 v17; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 int *v19; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 int v20; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 int a1b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 int a1a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 int a11b; // [sp+40h] [bp+28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 signed int a11a; // [sp+40h] [bp+28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 int a11c; // [sp+40h] [bp+28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254 v11 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 v19 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 v20 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 if ( a11 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4258 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 v12 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 a11b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4261 a1b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 v13 = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 a1a = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4264 v14 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 - a5 * v11->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 - v11->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 - a5 * v11->pFacePlane_old.vNormal.z - v11->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 a11c = abs(v14) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 if ( a11c > abs(v13) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 LODWORD(v16) = v14 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 HIDWORD(v16) = v14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4279 v15 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 a11a = v16 / a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4282 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 a11a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4285 v15 = abs(v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287 v17 = a4 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 HIWORD(a7a) = v17 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 if ( !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 *v19 = a11a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4301 if ( a11a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 *v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4307
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308 //----- (00475665) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 signed int __thiscall sub_475665(BLVFace *_this, int a2, __int16 a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 Vec3_short_ *v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 int v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 signed int v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316 Vec3_short_ *v8; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 signed int v9; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 int v10; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 signed int v11; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 Vec3_short_ *v12; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 signed int v13; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4322 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 int v15; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 bool v16; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4325 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 signed int v18; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327 int v19; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4328 signed int v20; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 int v21; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330 signed int v22; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 signed __int64 v23; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 signed int result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333 int v25; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 int v26; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335 signed int v27; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 signed int v28; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 signed int v29; // [sp+30h] [bp+Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338 signed int v30; // [sp+30h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 signed int v31; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341 v3 = _this->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 if ( BYTE1(v3) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 v27 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 v4 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 v5 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 v6 = 2 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354 word_720C10_intercepts_xs[2 * v28] = _this->pXInterceptDisplacements[v28] + v4[_this->pVertexIDs[v28]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 word_720B40_intercepts_zs[2 * v28] = _this->pYInterceptDisplacements[v5] + v4[_this->pVertexIDs[v5]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 word_720C10_intercepts_xs[2 * v28++ + 1] = _this->pXInterceptDisplacements[v5 + 1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 + v4[_this->pVertexIDs[v5 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 word_720B40_intercepts_zs[v6 + 1] = _this->pYInterceptDisplacements[v5 + 1] + v4[_this->pVertexIDs[v5 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 while ( v28 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 if ( BYTE1(v3) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 v7 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 v27 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 v8 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 v9 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 v10 = 2 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 word_720C10_intercepts_xs[2 * v29] = _this->pXInterceptDisplacements[v29] + v8[_this->pVertexIDs[v29]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 word_720B40_intercepts_zs[2 * v29] = _this->pZInterceptDisplacements[v9] + v8[_this->pVertexIDs[v9]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 word_720C10_intercepts_xs[2 * v29++ + 1] = _this->pXInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 word_720B40_intercepts_zs[v10 + 1] = _this->pZInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4383 while ( v29 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 v26 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 v11 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 v27 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394 v12 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 v13 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 v14 = 2 * v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 word_720C10_intercepts_xs[2 * v30] = _this->pYInterceptDisplacements[v30] + v12[_this->pVertexIDs[v30]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 word_720B40_intercepts_zs[2 * v30] = _this->pZInterceptDisplacements[v13] + v12[_this->pVertexIDs[v13]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 word_720C10_intercepts_xs[2 * v30++ + 1] = _this->pYInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 word_720B40_intercepts_zs[v14 + 1] = _this->pZInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 while ( v30 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 v15 = 2 * _this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 word_720C10_intercepts_xs[2 * _this->uNumVertices] = word_720C10_intercepts_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 word_720B40_intercepts_zs[v15] = word_720B40_intercepts_zs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 v16 = word_720B40_intercepts_zs[0] >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 if ( v15 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 if ( v31 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 v17 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 v18 = word_720B40_intercepts_zs[v25 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 if ( v16 ^ v18 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424 v19 = word_720C10_intercepts_xs[v17 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 if ( v19 >= v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429 v21 = v20 | word_720C10_intercepts_xs[v17] < v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430 if ( v21 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432 if ( !v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433 || (v22 = v19 - word_720C10_intercepts_xs[v17],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434 LODWORD(v23) = v22 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435 HIDWORD(v23) = v22 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436 word_720C10_intercepts_xs[v17]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437 + ((signed int)(((unsigned __int64)(v23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438 / (v18 - word_720B40_intercepts_zs[v17])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439 * ((v27 - (signed int)word_720B40_intercepts_zs[v17]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440 + 32768) >> 16) >= v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 v16 = v18 >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 while ( v25 < v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 if ( v31 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455 //----- (004759C9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 bool __fastcall sub_4759C9(BLVFace *a1, int a2, int a3, __int16 a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 __int16 v6; // si@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 __int16 v8; // si@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 int v9; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 __int16 v10; // si@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465 int v11; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466 bool v12; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 signed int v14; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 int v15; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 signed int v16; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 int v17; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 signed int v18; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 signed __int64 v19; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 bool result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4475 int v21; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4476 signed int v22; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 int v23; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 signed int v24; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 Vec3_int_ **a4a; // [sp+30h] [bp+Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 Vec3_int_ **a4b; // [sp+30h] [bp+Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4481 Vec3_int_ **a4c; // [sp+30h] [bp+Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4482 signed int a4d; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484 v4 = a1->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 if ( BYTE1(v4) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 v24 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 a4a = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 v5 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4496 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4497 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 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
4499 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
4500 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4502 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 if ( BYTE1(v4) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 a4b = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4516 v7 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519 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
4520 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
4521 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4528 v23 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4530 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 a4c = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4533 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 v9 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538 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
4539 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
4540 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 v11 = 2 * a1->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 a4d = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 word_720A70_intercepts_xs_plus_xs[2 * a1->uNumVertices] = word_720A70_intercepts_xs_plus_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 word_7209A0_intercepts_ys_plus_ys[v11] = word_7209A0_intercepts_ys_plus_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 v12 = word_7209A0_intercepts_ys_plus_ys[0] >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 if ( v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 goto LABEL_29;
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 if ( a4d >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 v13 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 v14 = word_7209A0_intercepts_ys_plus_ys[v21 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 if ( v12 ^ v14 >= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 v15 = word_720A70_intercepts_xs_plus_xs[v13 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 if ( v15 >= v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 v17 = v16 | word_720A70_intercepts_xs_plus_xs[v13] < v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568 if ( v17 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 if ( !v17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 || (v18 = v15 - word_720A70_intercepts_xs_plus_xs[v13],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 LODWORD(v19) = v18 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 HIDWORD(v19) = v18 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574 word_720A70_intercepts_xs_plus_xs[v13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 + ((signed int)(((unsigned __int64)(v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 / (v14 - word_7209A0_intercepts_ys_plus_ys[v13])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 * ((v24 - (signed int)word_7209A0_intercepts_ys_plus_ys[v13]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 + 32768) >> 16) >= v23) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 ++a4d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 v12 = v14 >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 while ( v21 < v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 if ( a4d != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593 //----- (00475D85) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594 bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 BLVFace *v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 int v5; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 int v6; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 int v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 signed int v9; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4602 signed __int64 v10; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 Vec3_int_ *v11; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 int v12; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4605 Vec3_int_ *v14; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 Vec3_int_ *v15; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 int v16; // [sp+18h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4608 int v17; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 int a4b; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 int a4c; // [sp+30h] [bp+Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4611 signed int a4a; // [sp+30h] [bp+Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4613 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 v15 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 if ( BYTE3(a4->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 || (v5 = (unsigned __int64)(a2->x * (signed __int64)a4->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 a4b = (unsigned __int64)(a2->y * (signed __int64)a4->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4619 v6 = (unsigned __int64)(a2->z * (signed __int64)v4->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4620 v7 = v5 + v6 + a4b,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 (v16 = v5 + v6 + a4b) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4622 || v7 > 0 && !(v4->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4623 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 v8 = v4->pFacePlane_old.vNormal.z * a1->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 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
4626 if ( v7 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628 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
4629 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4631 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633 if ( v9 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 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
4637 if ( a4c > abs(v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4638 || (LODWORD(v10) = v9 << 16, HIDWORD(v10) = v9 >> 16, a4a = v10 / v16, v17 = v10 / v16, v17 > *a3 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 || (v11 = v14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 LOWORD(v12) = LOWORD(v14->x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->x) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 HIWORD(v12) = LOWORD(v11->y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->y) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 v4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647 LOWORD(v11->z) + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->z) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 *a3 = a4a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653 //----- (00475F30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 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
4655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4656 BLVFace *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 int v10; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 int v11; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 int v12; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 char v13; // zf@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 int v14; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4662 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663 signed int v16; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 int v17; // ST20_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4665 signed __int64 v18; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 int v19; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 int *v21; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4668 int v22; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 int v23; // [sp+1Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 signed int v24; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4671
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4673 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 if ( BYTE3(a2->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675 || (v10 = (unsigned __int64)(a6 * (signed __int64)a2->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 v11 = (unsigned __int64)(a7 * (signed __int64)a2->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 v12 = (unsigned __int64)(a8 * (signed __int64)a2->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 v13 = v10 + v12 + v11 == 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4679 v14 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 v22 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 v13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 || v14 > 0 && !(a2->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 v15 = a4 * a2->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 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
4686 if ( v14 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688 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
4689 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693 if ( v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696 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
4697 if ( v17 > abs(v14)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4698 || (LODWORD(v18) = v16 << 16, HIDWORD(v18) = v16 >> 16, v24 = v18 / v22, v23 = v18 / v22, v23 > *v21 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 || (LOWORD(v19) = a3 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a6) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 HIWORD(v19) = a4 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a7) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701 !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702 v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 a9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 a5 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a8) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707 *v21 = v24 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4712
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715 //----- (004760D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716 PartyAction ActionQueue::Next()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4718 if (!uNumActions)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 return PARTY_INVALID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721 auto result = pActions[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 for (unsigned int i = 0; i < uNumActions - 1; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 pActions[i] = pActions[i + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724 --uNumActions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729 //----- (00476387) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730 bool __cdecl sub_476387()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 return (pNPCStats->pNewNPCData[57].uFlags & 0x80) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4734
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735 //----- (00476395) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 signed int v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740 char *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 if ( bNoNPCHiring == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 if ( (signed int)pNPCStats->uNumNewNPCs <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 if ( pParty->pHirelings[0].uProfession != uProfession )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 LOBYTE(result) = pParty->pHirelings[1].uProfession == uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 v3 = (char *)&pNPCStats->pNewNPCData[0].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 while ( *((int *)v3 + 4) != uProfession || !(*v3 & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 if ( v2 >= (signed int)pNPCStats->uNumNewNPCs )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4768 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 // 6BE3C5: using guessed type char bNoNPCHiring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 //----- (004763E0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773 void __cdecl InitializeAwards()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 char v2; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 char *v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 int v4; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 signed int v5; // [sp+Ch] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 char *v6; // [sp+10h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 Award *v7; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785 if ( pAwardsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 pAllocator->FreeChunk(pAwardsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 pAwardsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 pAwardsTXT_Raw = (char *)pEvents_LOD->LoadRaw("awards.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 strtok(pAwardsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 v7 = pAwards;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4791 for (uint i = 0; i < 104; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4793 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 v5 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4802 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4803 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4805 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4808 v2 = v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 while ( v2 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4812 v4 = (int)&v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 if ( v1[(int)v3] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4815 *(char *)v4 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 if ( v3 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 if ( v6 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824 v7->pText = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 if ( v6 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 v7->uSort = atoi(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 v1 = (char *)(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 while ( (signed int)(v6 - 1) <= 2 && (char *)v5 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4838 //while ( (signed int)v7 < (signed int)&dword_7241C8 );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4840 // 7241C8: using guessed type int dword_7241C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 //----- (004764C2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843 void __cdecl InitializeScrolls()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 const char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4852 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4853
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4854 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4855 if ( pScrollsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4856 pAllocator->FreeChunk(pScrollsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 pScrollsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4858 pScrollsTXT_Raw = (char *)pEvents_LOD->LoadRaw("scroll.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4859 strtok(pScrollsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4860 v6 = pScrolls;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4861 for (uint i = 0; i < 82; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4863 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4878 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4880 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4884 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4885 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4886 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4892 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893 *v6 = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4900 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4901 //while ( (signed int)v6 < (signed int)dword_723E80_award_related );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4902 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4903
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4904
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4905 //----- (00476590) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4906 void __cdecl InitializeMerchants()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4907 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 char *v0; // ebx@1
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4909 //char **v1; // edi@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 char *v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4911 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 char *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 signed int v6; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 char *v7; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918 if ( pMerchantsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 pAllocator->FreeChunk(pMerchantsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 pMerchantsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 pMerchantsTXT_Raw = (char *)pEvents_LOD->LoadRaw("merchant.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 strtok(pMerchantsTXT_Raw, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4923 //v1 = (char **)pMerchantsRepairPhrases;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4924 for (uint i = 0; i < 7; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4926 v7 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 v6 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928 v2 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933 if ( *v2 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4935 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4936 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4938 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4940 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4941 v3 = v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4943 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945 v5 = (int)&v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4946 if ( v2[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4947 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4948 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4949 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4951 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955 if ( v7 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4957 pMerchantsBuyPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4959 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4960 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4961 if ( v7 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4962 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4963 pMerchantsSellPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4965 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4967 if ( v7 == (char *)3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4968 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4969 pMerchantsRepairPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4971 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 if ( v7 - 3 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4974 pMerchantsIdentifyPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4979 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4980 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982 while ( (signed int)(v7 - 1) <= 4 && (char *)v6 == v0 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4983 //++v1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4984 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4985 //while ( (signed int)v1 < (signed int)pMerchantsIdentifyPhrases );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4987
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 //----- (00476682) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989 void __cdecl InitializeTransitions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001 if ( pTransitionsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 pAllocator->FreeChunk(pTransitionsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 pTransitionsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 pTransitionsTXT_Raw = (char *)pEvents_LOD->LoadRaw("trans.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 strtok(pTransitionsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 v6 = pTransitionStrings;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5007 for (uint i = 0; i < 464; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5009 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5024 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5030 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 *v6 = (char *)RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5044 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5047 //while ( (signed int)v6 < (signed int)"awards.txt" );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5049
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5050 //----- (00476750) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051 void __cdecl InitializeAutonotes()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053 char *v0; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 int v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 char *v2; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 char v3; // cl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 int v5; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 signed int v6; // [sp+0h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 if ( pAutonoteTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062 pAllocator->FreeChunk(pAutonoteTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063 pAutonoteTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064 pAutonoteTXT_Raw = (char *)pEvents_LOD->LoadRaw("autonote.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065 strtok(pAutonoteTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 v0 = (char *)&stru_723720[0].eType;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5067 for (uint i = 0; i < 195; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5069 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070 v2 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076 while ( v3 != 9 && v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 v3 = v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 v5 = (int)&v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 if ( !v2[v4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 *(char *)v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 if ( v1 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 *((int *)v0 - 1) = (int)RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5093 if ( v1 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5095 if ( _strcmpi(v2, "potion") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 if ( _strcmpi(v2, "stat") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099 if ( _strcmpi(v2, "seer") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101 if ( _strcmpi(v2, "obelisk") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102 *(int *)v0 = 5 - (_strcmpi(v2, "teacher") != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104 *(int *)v0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5106 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5108 *(int *)v0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5111 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5113 *(int *)v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5116 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5118 *(int *)v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5123 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 while ( v1 - 1 <= 2 && !v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131 v0 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5132 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5133 //while ( (signed int)v0 < (signed int)&pScrolls[1] );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5134 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5135
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5137 //----- (004768A9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5138 void __cdecl InitializeQuests()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5140 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5141 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 int v5; // esi@9
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5146 //const char **v6; // [sp+10h] [bp-8h]@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150 if ( pQuestsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 pAllocator->FreeChunk(pQuestsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 pQuestsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 pQuestsTXT_Raw = (char *)pEvents_LOD->LoadRaw("quests.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 strtok(pQuestsTXT_Raw, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5155
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5156 //v6 = pQuestTable;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5157 for (uint i = 0; i < 512; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5158 //do
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5160 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5167 if ( *v1 != '\t' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5173 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5174 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5175 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177 while ( v3 != '\t' );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5179 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5180 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5181 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 if ( v2 == 1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5190 pQuestTable[i] = RemoveQuotes(v1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5192 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5196 //++v6;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5197 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5198 //while ( (signed int)v6 < (signed int)&unk_723714 );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203 //----- (00476977) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5204 void NPCStats::Initialize2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 char *v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 char v5; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5209 int v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5210 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5211 char v10; // dl@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5212 char *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5213 int v12; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5214 char *v14; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5215 char v15; // dl@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5216 int v16; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5217 int v17; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5218 char v18; // zf@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5219 NPCStats_stru0 *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5220 signed int v20; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5221 signed int v21; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5222 char *v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5223 char *v23; // [sp+10h] [bp-10h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5224 char *v25; // [sp+14h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5225 char *v26; // [sp+14h] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5226 signed int v27; // [sp+14h] [bp-Ch]@39
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5227 //signed int v28; // [sp+18h] [bp-8h]@3
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5228 //signed int v29; // [sp+18h] [bp-8h]@20
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5229 signed int v30; // [sp+18h] [bp-8h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5230 char *v31; // [sp+1Ch] [bp-4h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5231
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5232 //v1 = this;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5233 //v2 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5234 if (pNPCTextTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5235 pAllocator->FreeChunk(pNPCTextTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5236
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5237 //v3 = (char *)pEvents_LOD->LoadRaw("npctext.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5238 pNPCTextTXT_Raw = (char *)pEvents_LOD->LoadRaw("npctext.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5239 strtok(pNPCTextTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5240
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5241 for (uint i = 0; i < 789; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5242 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5243 v4 = strtok(nullptr, "\r") + 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5244 v22 = nullptr;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5245 v25 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5246 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5247 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5249 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5250 if ( *v4 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5255 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5256 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5257 v5 = v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5259 while ( v5 != 9 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5260 //v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5262 v7 = (int)&v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5263 if ( !v4[(int)v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5264 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5265 *(char *)v7 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5266 if ( v6 == nullptr )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5268 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5270 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5272 if ( v22 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5273 pNPCTopics[i].pText = RemoveQuotes(v4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5275 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5276 v4 = (char *)(v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5277 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5278 while ( (signed int)(v22 - 1) <= 1 && v25 == nullptr );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5279 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5280
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5281 if (pNPCTopicTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5282 pAllocator->FreeChunk(pNPCTopicTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5283
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5284 //v8 = (char *)pEvents_LOD->LoadRaw("npctopic.txt", (int)v2);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5285 pNPCTopicTXT_Raw = (char *)pEvents_LOD->LoadRaw("npctopic.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5286 strtok(pNPCTopicTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5287
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5288 for (uint i = 0; i < 579; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5289 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5290 v9 = strtok(nullptr, "\r") + 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5291 v23 = nullptr;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5292 v26 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5293 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5296 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5297 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5302 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5303 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5304 v10 = v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5306 while ( v10 != 9 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5307 //v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5309 v12 = (int)&v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5310 if ( !v9[(int)v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5311 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5312 *(char *)v12 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5313 if ( v11 == nullptr )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5315 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5317 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5319 if ( v23 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5320 pNPCTopics[i].pTopic = RemoveQuotes(v9);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5322 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5324 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5325 while ( (signed int)(v23 - 1) <= 1 && v26 == nullptr );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5326 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5327
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5328 if (pNPCDistTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5329 pAllocator->FreeChunk(pNPCDistTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5330
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5331 //v13 = (char *)pEvents_LOD->LoadRaw("npcdist.txt", (int)v2);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5332 pNPCDistTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcdist.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5333 strtok(pNPCDistTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5334 strtok(nullptr, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5335 v30 = 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5336 v31 = &array_16544[0].field_4[1];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5337
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5338 char *v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5339 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5340 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5341 v14 = strtok(nullptr, "\r") + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342 v27 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5343 char *v24 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348 if ( *v14 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5351 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5357 while ( v15 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 v2 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 if ( !v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 if ( (signed int)v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372 if ( (signed int)v2 < 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5373 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5374 array_16544[(int)v2].field_4[v30] = atoi(v14);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5379 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380 *v31 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5386 while ( (signed int)(v2 - 1) <= 77 && !v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5387 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5388 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5389 if ( v30 < 59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5392 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5394 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5395 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5396 v19 = array_16544;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5397 v20 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5398 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5400 v19->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5402 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5403 v19->field_0 += v19->field_4[v21++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5404 while ( v21 < 59 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5405 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5406 --v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5408 while ( v20 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5409
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5410 if (pNPCDistTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5411 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5412 pAllocator->FreeChunk(pNPCDistTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5413 pNPCDistTXT_Raw = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417 //----- (00476C60) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418 void NPCStats::_476C60()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 {
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5420 for (uint i = 1; i < uNumNewNPCs; ++i)
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5421 pNewNPCData[i].pName = pNPCNames2[i - 1];
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5422
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5423 if (pParty->pHirelings[0].pName)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5424 pParty->pHirelings[0].pName = pParty->pHireling1Name;
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5425 if (pParty->pHirelings[1].pName)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 pParty->pHirelings[1].pName = pParty->pHireling2Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429 //----- (00476CB5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430 void NPCStats::Initialize1()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 char *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434 char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 char *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 char v5; // dl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 int v6; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 char *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 char *v8; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 char v10; // dl@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 int v11; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 int v12; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 char *v13; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 char *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 char v15; // dl@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 int v16; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448 int v17; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 char *v18; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 char *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 char v20; // cl@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 int v21; // edi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 int v22; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454 int v23; // [sp+Ch] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 signed int v24; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 signed int v25; // [sp+10h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 signed int v26; // [sp+10h] [bp-10h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 signed int v27; // [sp+10h] [bp-10h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 char *Str; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 NPCGreeting *pGreetings; // [sp+14h] [bp-Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 unsigned __int16 *pGroups; // [sp+14h] [bp-Ch]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 char **pCatchPhrase; // [sp+14h] [bp-Ch]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 signed int v32; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 signed int v33; // [sp+18h] [bp-8h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 signed int v34; // [sp+18h] [bp-8h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 signed int v35; // [sp+18h] [bp-8h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 signed int v36; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 signed int v37; // [sp+1Ch] [bp-4h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 signed int v38; // [sp+1Ch] [bp-4h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 signed int v39; // [sp+1Ch] [bp-4h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473 v2 = (char *)pEvents_LOD->LoadRaw("npcdata.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 v1->pNPCDataTXT_Raw = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 strtok(v2, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 v3 = (char *)&v1->pNPCData[1].house;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478 Str = (char *)v1->pNPCNames2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 v24 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 v4 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 v36 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 while ( v5 != 9 && v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 v23 = (int)&v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 if ( !v4[v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496 v32 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 switch ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 v7 = RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 *((int *)v3 - 5) = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 *(int *)Str = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508 *((int *)v3 - 4) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 *(int *)v3 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514 *((int *)v3 + 1) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 *((int *)v3 + 2) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520 *((int *)v3 + 3) = *v4 == 121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 *((int *)v3 + 5) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 *((int *)v3 + 6) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 *((int *)v3 + 7) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 *((int *)v3 + 8) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 *((int *)v3 + 9) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538 *((int *)v3 + 10) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 v4 = (char *)(v23 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 while ( v36 + 1 <= 15 && !v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 Str += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 --v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 while ( v24 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 v1->uNumNewNPCs = 501;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 v8 = (char *)pEvents_LOD->LoadRaw("npcgreet.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555 v1->pNPCGreetTXT_Raw = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 strtok(v8, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557 pGreetings = v1->pNPCGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 v25 = 205;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 while ( v10 != 9 && v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 v12 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575 v33 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 *(char *)v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581 pGreetings->pGreeting1 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586 pGreetings->pGreeting2 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 while ( v37 <= 2 && !v33 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 ++pGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 --v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596 while ( v25 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597 v13 = (char *)pEvents_LOD->LoadRaw("npcgroup.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598 v1->pNCPGroupTXT_Raw = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599 strtok(v13, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600 pGroups = v1->pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 v26 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 v14 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611 while ( v15 != 9 && v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 v34 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620 if ( v16 && v38 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 *pGroups = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 while ( v38 <= 1 && !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 ++pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5627 --v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 while ( v26 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 v18 = (char *)pEvents_LOD->LoadRaw("npcnews.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 v1->pNPCNewsTXT_Raw = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 strtok(v18, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 pCatchPhrase = v1->pCatchPhrases;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 v27 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 v19 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 v20 = *v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 while ( v20 != 9 && v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5647 v20 = v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 v22 = (int)&v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 if ( !v19[v21] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5651 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 *(char *)v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5653 if ( v21 && v39 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 *pCatchPhrase = (char *)RemoveQuotes(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 v19 = (char *)(v22 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658 while ( v39 <= 1 && !v35 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 ++pCatchPhrase;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 --v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 while ( v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 //----- (0047702F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5666 void NPCStats::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5668 //NPCStats *v1; // edi@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669 char *v2; // ebx@1
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5670 //char *v3; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 char *v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5672 char v5; // al@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673 int v6; // ecx@4
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5674 //char *v7; // eax@18
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 char *v8; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5676 char *v9; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 char v10; // dl@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5678 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5679 char v12; // zf@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5680 signed int v13; // [sp+Ch] [bp-14h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5681 int v14; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5682 int v15; // [sp+10h] [bp-10h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 char *v16; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5684 signed int v17; // [sp+14h] [bp-Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5685 unsigned int v18; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5686 char *v19; // [sp+18h] [bp-8h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5687 signed int v20; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5688 signed int v21; // [sp+1Ch] [bp-4h]@19
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5689 //v1 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5691 Initialize1();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692 Initialize2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 InitializeQuests();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695 InitializeAutonotes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 InitializeAwards();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 InitializeTransitions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 InitializeMerchants();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 InitializeScrolls();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 v2 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5701 field_17FC0 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5702 pNPCNamesTXT_Raw = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5703 //v3 = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5704 pNPCNamesTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5705 strtok(pNPCNamesTXT_Raw, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5706 v18 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5707 v16 = (char *)pNPCNames;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 v4 = strtok(v2, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 if ( *v4 == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5723 if ( v5 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5724 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 v14 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5729 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5730 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 if ( v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735 if ( v20 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5736 *((int *)v16 + 1) = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5738 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5740 *(int *)v16 = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5743 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5745 LABEL_45:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5746 if ( v20 == 1 && !uNumNPCNames[1] )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5747 uNumNPCNames[1] = v18;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5749 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5750 v4 += v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5751 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 while ( v20 <= 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 v16 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 if ( (signed int)v18 >= 540 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5758 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5759 pNPCProfTXT_Raw = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5760 uNumNPCNames[0] = v18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5761 //v7 = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5762 pNPCProfTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5763 strtok(pNPCProfTXT_Raw, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5764 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5765 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 strtok(0, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5767 v8 = (char *)&pProfessions[0].pJoinText;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5768 v19 = (char *)&pProfessions[0].pJoinText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5769 v13 = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5770 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788 while ( v10 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 v8 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 v15 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 switch ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 *((int *)v8 - 3) = atoi(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 *((int *)v8 - 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 *((int *)v8 - 2) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5807 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809 *(int *)v8 = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812 *((int *)v8 + 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5813 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822 v9 = (char *)(v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 while ( v21 <= 6 && !v17 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5825 v8 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 v12 = v13-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5827 v19 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 while ( !v12 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5830 uNumNPCProfessions = 59;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5832
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 //----- (00477266) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834 void NPCStats::Release()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 void *v2; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841 pAllocator->FreeChunk(this->pNPCTopicTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5842 v2 = v1->pNPCTextTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 pAllocator->FreeChunk(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846 pAllocator->FreeChunk(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5848 pAllocator->FreeChunk(v1->pNPCProfTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5849 v1->pNPCProfTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5850 pAllocator->FreeChunk(v1->pNPCNamesTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5851 v1->pNPCNamesTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 pAllocator->FreeChunk(v1->pNPCDataTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853 v1->pNPCDataTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 pAllocator->FreeChunk(v1->pNPCDistTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5855 v1->pNPCDistTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5856 v3 = (int)&v1->pNPCGreetTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5857 pAllocator->FreeChunk(v1->pNPCGreetTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5858 v1 = (NPCStats *)((char *)v1 + 98296);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5859 *(int *)v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5860 pAllocator->FreeChunk(v1->pNPCData[0].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5861 v1->pNPCData[0].pName = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5863
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5864 //----- (0047730C) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5865 int __fastcall const_1(int a1, int)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5867 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5869 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5870
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5871 //----- (0047732C) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5872 bool NPCStats::InitializeAdditionalNPCs(NPCData *a2, int a3, int a4, int a5)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5873 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5874 //NPCStats *v5; // ebx@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5875 signed __int64 v6; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5876 int v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5877 int v8; // edx@1
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5878 NPCData *v9; // edi@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5879 int v10; // eax@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5880 //int v11; // eax@23
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5881 int v12; // ecx@23
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5882 int v13; // edx@28
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5883 int v14; // esi@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5884 int v15; // edx@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5885 int v16; // ecx@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5886 int v17; // eax@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5887 int v18; // edx@37
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5888 signed int result; // eax@39
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5889 int v20; // [sp+Ch] [bp-Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5890 signed int v21; // [sp+10h] [bp-8h]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5891 signed int v22; // [sp+14h] [bp-4h]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5892 int v23; // [sp+24h] [bp+Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5893
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5894
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5895 v23 = a3 - 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5896 //v5 = this;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5897 v6 = (signed __int64)((double)v23 * -0.33333334);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5898 v7 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 28];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5899 v20 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 116];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5900 v8 = rand() % uNumNPCNames[v7];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5901 v9 = a2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5902 a2->uSex = v7;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5903 a2->pName = pNPCNames[v8][v7];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5904 v10 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5905 v22 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5906 v21 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5907
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5908 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5909 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5910 if ( v20 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5911 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5912 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5913 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5914 v23 = 2;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5915 a2 = (NPCData *)100;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5916 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5917 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5918 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5919 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5920 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5921 v23 = 201;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5922 a2 = (NPCData *)250;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5923 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5924 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5925 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5926 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5927 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5928 switch ( v20 - v10 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5930 case 1:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5931 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5932 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5933 v23 = 400;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5934 a2 = (NPCData *)430;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5936 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5937 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5938 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5939 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5940 v23 = 460;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5941 a2 = (NPCData *)490;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5942 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5944 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5945 case 2:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5946 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5947 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5948 v23 = 500;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5949 a2 = (NPCData *)520;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5951 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5952 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5953 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5954 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5955 v23 = 530;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5956 a2 = (NPCData *)550;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5957 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5959 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5960 case 3:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5961 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5962 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5963 v23 = 300;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5964 a2 = (NPCData *)330;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5966 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5967 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5968 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5969 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5970 v23 = 360;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5971 a2 = (NPCData *)387;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5972 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5974 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5976 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5977 v12 = v23 + rand() % ((int)a2 - v23 + 1);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5978 if ( const_1(v12, v7) == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5979 v21 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5980 ++v22;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5981 if ( v22 >= 4 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5982 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5983 v12 = v23;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5984 v21 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5985 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5986 if ( v21 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5987 break;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5988 v10 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5989 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5990
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5991 v9->uPortraitID = v12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5992 v9->uFlags = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5993 v9->fame = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5994 v13 = rand() % 100 + 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5995
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5996 if ( v13 >= 60 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5997 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5998 if ( v13 >= 90 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5999 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6000 if ( v13 >= 95 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6001 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6002 if ( v13 >= 98 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6003 v9->rep = -600;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6004 else
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6005 v9->rep = 400;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6006 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6007 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6008 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6009 v9->rep = -300;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6010 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6011 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6012 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6013 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6014 v9->rep = 200;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6015 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6016 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6017 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6018 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6019 v9->rep = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6020 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6021
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6022 //v14 = (int)((char *)v5 + 64 * a5);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6023 //v15 = rand() % *(_DWORD *)(v14 + 91460);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6024 v15 = rand() % array_16544[a5].field_0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6025 v16 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6026 v17 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6027 v18 = v15 + 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6028
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6029 if ( v18 > 0 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6030 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6031 do
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6032 //v14 += *(char *)(v14 + v17++ + 0x16548);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6033 v16 += array_16544[a5].field_4[v17++];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6034 while ( v16 < v18 );
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6035 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6036 v9->uProfession = v17 - 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6037 v9->house = a4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6038 v9->field_24 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6039 v9->joins = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6040 return true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6042 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044 //----- (0047752B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045 int __cdecl GetPartyReputation()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047 DDM_DLV_Header *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 signed int v1; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050 v0 = &pOutdoor->ddm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052 v0 = &pIndoor->dlv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 if ( CheckHiredNPCSpeciality(0x2Du) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 v1 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 if ( CheckHiredNPCSpeciality(0x33u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 if ( CheckHiredNPCSpeciality(0x30u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060 if ( CheckHiredNPCSpeciality(0x32u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 if ( CheckHiredNPCSpeciality(0x34u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 return v1 + v0->uReputation;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071 //----- (004775ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072 int stru6_stru1_indoor_sw_billboard::_4775ED(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6084 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6086 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6089 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6117 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6118 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6119 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6120 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6121 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6122 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6123 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6124 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6126 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6127 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6128 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6129 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6131 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6132 if ( *(float *)(v4 - 15) <= (double)a2 && *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6133 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6134 if ( *(float *)v5 <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6135 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6136 if ( *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6142 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6143 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6144 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6145 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6146 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6147 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6148 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6153 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6154 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6155 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6156 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6157 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6158 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6159 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6160 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6166 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6167 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6168 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6169 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6171 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6172 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6178 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6179 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6180 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6181 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6182 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6183 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6184 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6189 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6190 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6191 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6192 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6193 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6194 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6195 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6196 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6202 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6203 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6204 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6205 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6206 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6207 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6208 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6209 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6215 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6218 //----- (00477927) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6219 int stru6_stru1_indoor_sw_billboard::_477927(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6221 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6222 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6227 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6228 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6229 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6230 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6231 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6232 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6233 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6238 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6239 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6241 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6244 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6246 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6247 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6248 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6249 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6250 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6256 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6257 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6258 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6259 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6260
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6266 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6267 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6268 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6269 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6270 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6271 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6273 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6274 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6275 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6276 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6278 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6279 if ( *(float *)(v4 - 15) >= (double)a2 && *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6280 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6281 if ( *(float *)v5 >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6282 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6283 if ( *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6285 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6286 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6287 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6288 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6289 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6290 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6291 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6292 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6293 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6294 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6295 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6296 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6297 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6298 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6299 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6300 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6301 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6302 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6303 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6304 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6305 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6306 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6307 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6308 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6309 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6310 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6311 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6312 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6313 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6314 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6315 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6316 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6318 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6319 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6320 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6321 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6322 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6323 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6324 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6325 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6326 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6327 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6328 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6329 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6330 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6331 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6332 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6333 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6334 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6336 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6337 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6338 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6339 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6340 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6341 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6342 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6343 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6344 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6345 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6346 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6347 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6348 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6349 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6350 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6351 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6352 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6353 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6354 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6355 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6356 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6357 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6359 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6360 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6361 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6362 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6364
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6365 //----- (00477C61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6366 int stru6_stru1_indoor_sw_billboard::sub_477C61()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6368 stru6_stru1_indoor_sw_billboard *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6369 int v2; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6370 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6371 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6372 double v5; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6373 double v6; // st6@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6374 double v7; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6375 float v8; // ST30_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6376 float v9; // ST24_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6377 double v10; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6378 double v11; // st6@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6379 double v12; // st5@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6380 float v13; // ST24_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6381 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6382 char *v15; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6383 signed int v16; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6384 __int16 v17; // fps@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6385 unsigned __int8 v18; // c2@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6386 unsigned __int8 v19; // c3@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6387 double v20; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6388 float v21; // ST18_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6389 float v22; // ST2C_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6390 float v23; // ST34_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6391 float v24; // ST24_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6392 double v25; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6393 double v26; // st6@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6394 float v27; // ST34_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6395 float v28; // ST30_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6396 int v29; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6397 signed int v31; // [sp+8h] [bp-28h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6398 float v32; // [sp+Ch] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6399 float v33; // [sp+14h] [bp-1Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6400 float v34; // [sp+18h] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6401 float v35; // [sp+1Ch] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6402 float v36; // [sp+20h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6403 float v37; // [sp+24h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6404 float v38; // [sp+24h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6405 float v39; // [sp+28h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6406 float v40; // [sp+28h] [bp-8h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6407 float v41; // [sp+2Ch] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6408 float v42; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6409
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6410 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6411 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6413 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6414 if ( v1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6416 v3 = (int)&v1->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6417 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6419 v4 = *(float *)(v3 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6420 LODWORD(v37) = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6421 LODWORD(v36) = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6422 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6424 v5 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6425 v6 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6426 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6428 v41 = pBLVRenderParams->fSineY * v6 + pBLVRenderParams->fCosineY * v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6429 v7 = pBLVRenderParams->fSineY * v5 - pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6431 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6433 v41 = pBLVRenderParams->fCosineY * v5 - pBLVRenderParams->fSineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 v7 = pBLVRenderParams->fSineY * v5 + pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6436 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6437 v9 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6438 v10 = pBLVRenderParams->fCosineNegX * v41 - pBLVRenderParams->fSineNegX * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6439 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6440 v12 = pBLVRenderParams->fCosineNegX * v9 + pBLVRenderParams->fSineNegX * v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6441 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6444 v42 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 v39 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6446 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6448 v10 = pBLVRenderParams->fSineY * v39 + pBLVRenderParams->fCosineY * v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6449 v11 = pBLVRenderParams->fSineY * v42 - pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6451 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6453 v10 = pBLVRenderParams->fCosineY * v42 - pBLVRenderParams->fSineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6454 v11 = pBLVRenderParams->fSineY * v42 + pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 v12 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6458 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6459 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6460 *(int *)(v3 + 84) = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6461 v14 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6462 *(float *)(v3 + 76) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6463 *(int *)(v3 + 88) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6464 *(float *)(v3 + 80) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6465 v3 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6467 while ( v2 < v1->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6470 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6472 v15 = (char *)&this->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6473 v31 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6474 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6476 v40 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6477 v32 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6478 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6479 v34 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationY) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6480 v16 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6481 LODWORD(v38) = *(int *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6482 v33 = (double)v16 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 //UNDEF(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6484 v20 = *((float *)v15 - 1) - (double)pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6485 if ( v19 | v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6487 v27 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6488 LODWORD(v35) = *((int *)v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6489 v28 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6490 v25 = v33 * v28 + v34 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6491 v26 = v34 * v28 - v33 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6493 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6495 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6496 v22 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6497 v23 = v33 * v22 + v34 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6498 v24 = *((float *)v15 + 1) - (double)pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6499 v25 = v32 * v24 + v40 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6500 v26 = v34 * v22 - v33 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6501 v35 = v40 * v24 - v32 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6502 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6503 *((int *)v15 + 21) = LODWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6504 v29 = *((int *)v15 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6505 *((float *)v15 + 19) = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6506 *((int *)v15 + 22) = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6507 *((float *)v15 + 20) = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6508 v15 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6509 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6511 while ( v31 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6512 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6513 v1->field_10 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6514 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6516
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6517 //----- (00477F63) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6518 bool stru6_stru1_indoor_sw_billboard::sub_477F63()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6520 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6521 stru6_stru1_indoor_sw_billboard *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6522 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6523 int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6524 char *v5; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6525 int v6; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6526 float v7; // ST08_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6527 signed int v9; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6528 float v10; // [sp+10h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6529
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6530 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6531
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6532 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6533 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6535 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6537 v10 = 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6538 v3 = (double)pBLVRenderParams->field_40 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6540 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6542 v10 = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6543 v3 = 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6545 v4 = a1->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6546 if ( v4 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6548 v5 = (char *)&a1->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6549 v6 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6550 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6552 if ( v3 >= *(float *)v5 || *(float *)v5 >= (double)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6554 if ( v3 < *(float *)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6555 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6556 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6557 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6559 v5 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6560 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6562 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6563 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6565 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6567 v2->_477927(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6568 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6570 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6571 memcpy(&v2->field_14[40], &v2->field_14[20], 16 * v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6572 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6574 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6575 _4775ED(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6576 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6579 //----- (0047802A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6580 int stru6_stru1_indoor_sw_billboard::sub_47802A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6582 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6583 stru6_stru1_indoor_sw_billboard *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6584 int v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6586 float v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6587 double v6; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 double v7; // ST30_8@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6589 double v8; // st6@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6590 double v9; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6591 char *v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6592 float v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6593 double v12; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6594 double v13; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6595 double v14; // st5@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6596 signed int v16; // [sp+38h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6597 int a6; // [sp+3Ch] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6598 int a5; // [sp+40h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6600 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6602 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6603 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6604 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6605 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6606 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6607 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6608 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6610 v4 = (char *)&a1->field_14[42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6611 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6613 LODWORD(v5) = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6614 v6 = (double)pBLVRenderParams->field_40 * 0.000015258789 / *((float *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6615 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6617 v7 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6618 pGame->pIndoorCameraD3D->Project(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6619 COERCE_UNSIGNED_INT64(v5 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6620 COERCE_UNSIGNED_INT64(*((float *)v4 - 1) + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6621 COERCE_UNSIGNED_INT64(*(float *)v4 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6622 &a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6623 &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6624 *((float *)v4 + 18) = (double)a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6625 *((float *)v4 + 19) = (double)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6626 *((float *)v4 + 20) = (double)SLODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6628 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6630 *((float *)v4 + 18) = (double)pBLVRenderParams->uViewportCenterX - v6 * *((float *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6631 v8 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6632 v9 = v6 * *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6633 *((int *)v4 + 20) = LODWORD(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6634 *((float *)v4 + 19) = v8 - v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 *((int *)v4 + 21) = *((int *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6637 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 && (double)(signed int)pViewport->uViewportZ > *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6639 && (double)(signed int)pViewport->uViewportY <= *((float *)v4 + 19)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6640 && (double)(signed int)pViewport->uViewportW > *((float *)v4 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6641 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6642 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6643 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6645 while ( v3 < v2->field_10 );
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 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6652 v10 = (char *)&a1->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6653 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6655 LODWORD(v11) = *(int *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6656 v12 = (double)pOutdoorCamera->int_fov_rad / *(float *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6657 *((float *)v10 + 20) = (double)pViewport->uScreenCenterX - v12 * *((float *)v10 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6658 v13 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659 v14 = v12 * *((float *)v10 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6660 *((int *)v10 + 22) = LODWORD(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6661 *((int *)v10 + 23) = *((int *)v10 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6662 *((float *)v10 + 21) = v13 - v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6663 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6664 && (double)(signed int)pViewport->uViewportZ > *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6665 && (double)(signed int)pViewport->uViewportY <= *((float *)v10 + 21)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6666 && (double)(signed int)pViewport->uViewportW > *((float *)v10 + 21) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6667 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6668 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6669 v10 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6671 while ( v1 < v2->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6674 return v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6676
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6677
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6678
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6679 //----- (004783FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6680 void __cdecl sub_4783FA_construct_global_73D150()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6682 char *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6683 signed int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6684
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6685 v0 = (char *)&array_73D150[0].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6686 v1 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6687 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 *(float *)v0 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6690 v0 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6691 --v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6693 while ( v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6694 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6696
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6697
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6698 //----- (0047840D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6699 char Render::DrawBuildingsD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6701 IndoorCameraD3D *v0; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6702 char result; // al@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6703 Vec3_int_ **v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 Vec3_int_ *v3; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 ODMFace *pFace; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6706 int v5; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6707 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 stru148 *v7; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 LightmapBuilder *v8; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6710 int v9; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6711 char v10; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 Texture *pFaceTexture; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 signed int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6714 unsigned int v13; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715 unsigned int v14; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716 unsigned int v15; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717 unsigned int v16; // edi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718 int v17; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 int v18; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 char *v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 char *v20; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6722 Vec3_int_ *v21; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 int v22; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 char *v23; // edi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6725 int v24; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 int v25; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 int v26; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 int v28; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6730 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 double v30; // st7@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 LightmapBuilder *v31; // edi@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 signed int v32; // eax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 int v33; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6735 unsigned int v34; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6736 std::string v35; // [sp-18h] [bp-70h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737 int v36; // [sp-14h] [bp-6Ch]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6738 RenderVertexSoft *v37; // [sp-10h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 int v38; // [sp-Ch] [bp-64h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6740 LightmapBuilder *v39; // [sp-8h] [bp-60h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6741 int v40; // [sp-4h] [bp-5Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6742 std::string *v41; // [sp+Ch] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6743 Vec3_int_ *v42; // [sp+10h] [bp-48h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744 LightmapBuilder *pLightmapBuilder; // [sp+14h] [bp-44h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 float v44; // [sp+18h] [bp-40h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6746 float v45; // [sp+1Ch] [bp-3Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6747 ODMFace *v46; // [sp+20h] [bp-38h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6748 IndoorCameraD3D *v47; // [sp+24h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 unsigned int v48; // [sp+28h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6750 int v49; // [sp+2Ch] [bp-2Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6751 int v50; // [sp+30h] [bp-28h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 int v51; // [sp+34h] [bp-24h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6753 int v52; // [sp+38h] [bp-20h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6754 int v53; // [sp+3Ch] [bp-1Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6755 Vec3_int_ *v54; // [sp+40h] [bp-18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6756 int a1; // [sp+44h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 Vec3_int_ **v56; // [sp+48h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6758 int uNumVertices; // [sp+4Ch] [bp-Ch]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6759 int unused; // [sp+50h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6760 int a3; // [sp+57h] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6761
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6762 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6764 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
6765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6766 unused = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6767 v0 = pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6768 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6769 v47 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6770 result = LOBYTE(pOutdoor->pBModels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6771 v41 = (std::string *)pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6772 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774 v2 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6775 v56 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6776 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6778 if ( IsBModelVisible(a1, &unused) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 *(v2 - 3) = (Vec3_int_ *)((unsigned int)*(v2 - 3) | 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6782 pFace = (ODMFace *)v2[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6783 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 v42 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6786 if ( (signed int)v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6789 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6791 v2 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6792 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 v56 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6794 if ( a1 >= (signed int)v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6795 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6797 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6799 if ( pFace->uFaceAttributes & 0x2000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6800 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6801 v5 = (int)*(v2 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6802 v6 = pFace->pVertexIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6803 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6804 v7 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6805 v8 = *(LightmapBuilder **)(v5 + 12 * v6 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6806 *(int *)&v7->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6807 pLightmapBuilder = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 v9 = pFace->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6809 v10 = (BYTE1(pFace->uFaceAttributes) & 0x40) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6810 v48 = pFace->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6811 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 v48 = pTextureFrameTable->GetFrameTexture(v9, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6814 v9 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 pFaceTexture = (Texture *)(v9 != -1 ? (int)&pBitmaps_LOD->pTextures[v9] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 v7->pTexture = pFaceTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6818 v12 = (v9 != -1 ? pBitmaps_LOD->pTextures[v9].uTextureWidth : 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 v49 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6820 v49 = pFaceTexture->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6821 v10 = (pFace->uFaceAttributes & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 v45 = 1.0 / (double)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6823 v44 = 1.0 / (double)v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 *(int *)&v7->flags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6826 if ( BYTE2(pFace->uFaceAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 HIBYTE(v7->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 v13 = pFace->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6829 if ( v13 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6831 HIBYTE(v7->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6833 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 if ( v13 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 HIBYTE(v7->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 v14 = pFace->uFaceAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6839 if ( BYTE1(v14) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6841 *(int *)&v7->flags |= 0x2000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6842 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6845 if ( v14 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 HIBYTE(v7->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6848 v15 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6849 v7->sTextureDeltaU = pFace->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6850 v7->sTextureDeltaV = pFace->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6851 v16 = v15 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6852 if ( pFace->pFacePlane.vNormal.z && (v40 = pFace->pFacePlane.vNormal.z, abs(v40) >= 59082) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6855 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6856 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6857 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6860 v7->sTextureDeltaV -= v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6861 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6864 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6865 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6866 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6867 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6868 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6869 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6871 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6872 v7->sTextureDeltaV += v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6873 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6876 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6877 if ( BYTE1(v17) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6879 v7->sTextureDeltaU -= v16 & v7->pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6881 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6883 if ( BYTE1(v17) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6884 v7->sTextureDeltaU += v16 & v7->pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6886 v18 = pFace->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6887 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6888 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6889 uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6890 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6892 v19 = (char *)&array_73D150[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6893 v20 = (char *)pFace->pTextureUIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 v51 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6895 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6897 v21 = &(*(v56 - 1))[*((short *)v20 - 20)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6898 *((float *)v19 - 2) = (double)v21->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6899 *((float *)v19 - 1) = (double)v21->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6900 *(float *)v19 = (double)v21->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6901 v19 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 v52 = v7->sTextureDeltaU + *(short *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6903 *((float *)v19 - 5) = (double)v52 * v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6904 v22 = v7->sTextureDeltaV + *((short *)v20 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6905 v20 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6906 v10 = v51-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6907 v52 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6908 *((float *)v19 - 4) = (double)v22 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6910 while ( !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6911 v23 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6912 v51 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 *(float *)&pLightmapBuilder = (double)(signed int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6914 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6916 if ( *(float *)&pLightmapBuilder == *((float *)v23 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6917 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6918 v47->ViewTransform((RenderVertexSoft *)(v23 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6919 if ( *(float *)v23 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6921 if ( *(float *)v23 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6922 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6923 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6926 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928 v47->_436BB7_project_and_stuff((RenderVertexSoft *)(v23 - 12), 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6930 v23 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6931 --v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6933 while ( v51 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934 v18 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6936 if ( v53 == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 LOBYTE(v7->field_32) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 v24 = pOutdoor->vSunlight.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6939 v7->pODMFace = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 v7->uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 v7->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6942 pLightmapBuilder = (LightmapBuilder *)-v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 v51 = pFace->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944 v51 = (unsigned __int64)(-v24 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945 v53 = pFace->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946 pLightmapBuilder = (LightmapBuilder *)-pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6947 v53 = (unsigned __int64)(-pOutdoor->vSunlight.y * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948 v52 = pFace->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949 v52 = (unsigned __int64)(-pOutdoor->vSunlight.z * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 pLightmapBuilder = (LightmapBuilder *)(v51 + v53 + v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 v51 = 20 * (int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6952 result = 20 - (20 * (signed int)pLightmapBuilder >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6953 v7->field_58 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 if ( result < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6955 v7->field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 if ( v7->field_58 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6957 v7->field_58 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6958 if ( pOutdoorCamera->numStru148s >= 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6960 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6961 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6962 if ( ODMFace::IsBackfaceCulled(pFace, array_73D150, v7) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6964 LOBYTE(v25) = (char)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6965 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6966 pFace->bVisible = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 v7->uBModelFaceID = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6968 LOWORD(v25) = (unsigned __int8)v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6969 v7->uBModelID = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6970 v27 = 8 * (v25 | (v26 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971 LOBYTE(v27) = v27 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6972 v7->field_50 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6973 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6975 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6976 v29 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6978 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6979 v30 = 1.0 / (array_73D150[v28].vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6980 memcpy(&array_50AC10[v28], &array_73D150[v28], sizeof(array_50AC10[v28]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6981 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6982 --v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6983 array_50A2B0[v28 + 49].flt_20 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6985 while ( v29 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6986 pFace = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6989 static stru154 static_RenderBuildingsD3D_stru_73C834;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6990 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6993 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 static_RenderBuildingsD3D_byte_73C84C_init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996 stru154::stru154(&static_RenderBuildingsD3D_stru_73C834);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6997 atexit(loc_4789D4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7000 v40 = (int)pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001 pLightmapBuilder = pGame->pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 v31 = pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7003 pLightmapBuilder->ApplyLights_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7004 pDecalBuilder->ApplyDecals_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7005 v31->std__vector_000004_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7006 LOBYTE(v31) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 if ( stru_F8AD28.field_AC > 0 || pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7009 v31 = (LightmapBuilder *)(v50 ? 3 : v49 != 0 ? 5 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 static_RenderBuildingsD3D_stru_73C834._49B04D(pFace, (BSPVertexBuffer *)v56 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7011 if ( pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7012 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7013 v40 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7014 v39 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7015 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7016 v37 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7017 v36 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7018 pDecalBuilder->ApplyDecals(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7019 31 - v7->field_58,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7020 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7021 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 array_50AC10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7024 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7025 (char)v31,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7026 -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 if ( stru_F8AD28.field_AC > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 pLightmapBuilder->ApplyLights(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 &stru_F8AD28,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7032 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7034 array_50AC10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 0.0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 (char)v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7037 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 v32 = sr_424CD7(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7040 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7043 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 v32 = sr_424EE0_MakeFanFromTriangle(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 v7->uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7048 OutdoorCamera::Project(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 if ( uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 v33 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7053 if ( v33 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 if ( BYTE1(v33) & 0x3C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7056 v34 = pRenderer->pHDWaterBitmapIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7057 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 v34 = pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7059 v40 = (int)pBitmaps_LOD->pHardwareTextures[v34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7061 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 v40 = (int)pBitmaps_LOD->pHardwareTextures[v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7065 pRenderer->DrawPolygon(uNumVertices, v7, pFace, (IDirect3DTexture2 *)v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7067 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7069 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7070 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7071 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7072 v54 = (Vec3_int_ *)((char *)v54 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7073 v2 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7074 ++pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7075 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7076 if ( (signed int)v54 >= (signed int)v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7077 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7080 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7082 // 73C84C: using guessed type char static_RenderBuildingsD3D_byte_73C84C_init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7083
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 //----- (004789DE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7085 BSPModel *Render::DrawBuildingsSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 BSPModel *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7088 unsigned int *v1; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7089 int v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7091 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7094 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 double v8; // st7@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096 char *v9; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7097 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7098 double v11; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7099 stru148 *v12; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 double v13; // st7@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 double v14; // ST4C_8@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7102 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 int v16; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7104 int v17; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 unsigned __int8 v18; // sf@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7106 unsigned __int8 v19; // of@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 int v20; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 int v21; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7109 int v22; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 int v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 int v24; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7112 Texture *v25; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 int v26; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 signed int v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7115 double v28; // st6@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 double v29; // st5@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 int v30; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 int v31; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7119 double v32; // st4@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 int v33; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 char v34; // zf@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 BSPVertexBuffer *v35; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 unsigned int v36; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 signed int v37; // esi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 int v38; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7126 signed int v39; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7127 char *v40; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 double v41; // ST1C_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 double v42; // ST24_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7130 signed int v43; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 signed int v44; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 int v45; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 signed int v46; // edx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7134 char *v47; // ecx@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 double v48; // ST34_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136 double v49; // ST44_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7137 int v50; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138 signed int v51; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139 char *v52; // edx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7140 double v53; // ST3C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7141 double v54; // ST2C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7142 float v55; // [sp+44h] [bp-7Ch]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7143 float v56; // [sp+48h] [bp-78h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 float v57; // [sp+4Ch] [bp-74h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7145 float v58; // [sp+50h] [bp-70h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7146 int v59; // [sp+54h] [bp-6Ch]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7147 int v60; // [sp+58h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7148 float v61; // [sp+5Ch] [bp-64h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7149 float v62; // [sp+60h] [bp-60h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7150 float v63; // [sp+64h] [bp-5Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7151 float v64; // [sp+68h] [bp-58h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7152 int v65; // [sp+6Ch] [bp-54h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7153 int v66; // [sp+70h] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7154 int v67; // [sp+74h] [bp-4Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7155 int v68; // [sp+78h] [bp-48h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7156 int v69; // [sp+7Ch] [bp-44h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7157 int v70; // [sp+80h] [bp-40h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7158 int v71; // [sp+84h] [bp-3Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7159 float v72; // [sp+88h] [bp-38h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7160 int v73; // [sp+8Ch] [bp-34h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161 int v74; // [sp+90h] [bp-30h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7162 int v75; // [sp+94h] [bp-2Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7163 int v76; // [sp+98h] [bp-28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7164 int v77; // [sp+9Ch] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7165 unsigned int *v78; // [sp+A0h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166 int v79; // [sp+A4h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7167 int a1; // [sp+A8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7168 int v81; // [sp+ACh] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7169 int v82; // [sp+B0h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7170 int v83; // [sp+B4h] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7171 signed int v84; // [sp+B8h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7172 int a2; // [sp+BCh] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7174 a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7175 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7176 result = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7177 v66 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7178 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7180 v1 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7181 v78 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7182 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7184 if ( IsBModelVisible(a1, &a2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7186 *(v1 - 3) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7187 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 v3 = v1[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7189 v79 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7190 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 v68 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7192 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7193 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7195 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 v1 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7198 result = (BSPModel *)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199 v78 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200 if ( a1 >= v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7201 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7203 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 if ( !(*(char *)(v3 + 29) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 v4 = 3 * *(short *)(v3 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7208 v5 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209 v67 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7210 v6 = *(int *)(*(v1 - 1) + 4 * v4 + 8) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 v83 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7213 v74 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 v7 = *(char *)(v3 + 302);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7216 v77 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7219 v8 = (double)v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7220 v9 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 v81 = v3 + 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 v83 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7223 *(float *)&v84 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7226 v10 = *(int *)(v5 + 4) + 12 * *(short *)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 *((float *)v9 - 3) = (double)*(signed int *)v10 + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 *((float *)v9 - 2) = (double)*(signed int *)(v10 + 4) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 v11 = (double)*(signed int *)(v10 + 8) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7230 *((float *)v9 - 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7231 if ( *(float *)&v84 == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 pGame->pIndoorCameraD3D->ViewTransform((RenderVertexSoft *)(v9 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7234 if ( *(float *)v9 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 if ( *(float *)v9 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7238 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 v74 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7241 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243 pGame->pIndoorCameraD3D->_436BB7_project_and_stuff((RenderVertexSoft *)(v9 - 12), 1u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 v81 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7246 v9 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7247 --v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 if ( !v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7249 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7250 v5 = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7252 v7 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7254 v12 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7255 *(int *)&v12->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7256 if ( v82 == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7257 *(int *)&v12->flags = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7258 v12->pODMFace = (ODMFace *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7259 v12->uNumVertices = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7260 v12->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7261 v84 = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7262 v83 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7263 v82 = -pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7264 v84 = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 v82 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 v81 = -pOutdoor->vSunlight.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7267 v84 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7268 v81 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7269 v84 = v83 + v82 + ((unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 v13 = (double)v84 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7271 if ( v13 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7272 v13 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7273 *(float *)&v84 = v13 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7274 v14 = *(float *)&v84 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7275 v71 = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7276 v15 = (int)&v12->field_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7277 v12->field_58 = 31 - LOBYTE(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7278 if ( (char)(31 - LOBYTE(v14)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7279 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7280 if ( *(char *)v15 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7281 *(char *)v15 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7282 v16 = *(short *)(v3 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7283 if ( *(char *)(v3 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7284 v16 = pTextureFrameTable->GetFrameTexture(v16, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7285 v17 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7286 result = (BSPModel *)&pBitmaps_LOD->pTextures[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7287 v19 = __OFSUB__(pOutdoorCamera->numStru148s, 1999);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7288 v18 = pOutdoorCamera->numStru148s - 1999 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7289 v12->pTexture = (Texture *)(v17 != -1 ? (int)result : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 if ( !(v18 ^ v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7291 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7292 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7294 if ( !ODMFace::IsBackfaceCulled((ODMFace *)v3, array_73D150, v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7297 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7301 LOBYTE(v20) = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7302 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 *(char *)(v3 + 305) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 v12->uBModelFaceID = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7305 LOWORD(v20) = (unsigned __int8)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 v12->uBModelID = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7307 v22 = 8 * (v20 | (v21 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 LOBYTE(v22) = v22 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7309 v12->field_50 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 if ( *(char *)(v3 + 28) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 *(int *)&v12->flags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7312 if ( *(char *)(v3 + 30) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 v23 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7315 if ( v23 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 if ( v23 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7322 HIBYTE(v12->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324 v24 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 if ( BYTE1(v24) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 HIBYTE(v12->flags) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7329 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 if ( v24 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 HIBYTE(v12->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 v25 = v12->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 v27 = v25->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7337 v84 = v25->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 v28 = 1.0 / (double)v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 v29 = 1.0 / (double)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7340 if ( v77 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 v30 = v3 + 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7343 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 v83 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7345 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 v32 = 1.0 / (*(float *)(v31 * 48 + 7590236) + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7348 memcpy(&array_50AC10[v31], &array_73D150[v31], sizeof(array_50AC10[v31]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7349 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7350 array_50A2B0[v31 + 49].flt_20 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7351 v84 = v12->sTextureDeltaU + *(short *)(v30 - 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7352 array_50A2B0[v31 + 49].u = (double)v84 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7353 v33 = v12->sTextureDeltaV + *(short *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7354 v30 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7355 v34 = v83-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7356 v84 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7357 array_50A2B0[v31 + 49].v = (double)v33 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7359 while ( !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7360 v3 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7361 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7363
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7364 static stru154 static_sub_004789DE_stru_73C818; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7366 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7368 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7369
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7370 static_sub_004789DE_byte_73C830__init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371 stru154::stru154(&static_sub_004789DE_stru_73C818);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7372 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7373
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7374 pGame->pLightmapBuilder->ApplyLights_OutdoorFace((ODMFace *)v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7375 if ( stru_F8AD28.field_AC <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7377 v12->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7379 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 v35 = (BSPVertexBuffer *)(v78 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382 v12->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 static_sub_004789DE_stru_73C818._49B04D((ODMFace *)v3, v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385 v55 = static_sub_004789DE_stru_73C818.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 v56 = static_sub_004789DE_stru_73C818.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 v57 = static_sub_004789DE_stru_73C818.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, v26, (Vec3_float_ *)&v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 v36 = sr_4250FE(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 v37 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 if ( !v36 || (OutdoorCamera::Project(v36), v38 = sr_4254D2(v37), (v12->uNumVertices = v38) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 v40 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 LODWORD(v64) = *((int *)v40 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 v41 = v64 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 v69 = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406 dword_50B638[v39] = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 LODWORD(v63) = *(int *)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408 v42 = v63 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409 v73 = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410 v40 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 dword_50B570[v39++] = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 while ( v39 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 if ( v75 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 v43 = sr_4252E8(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 v44 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 if ( !v43 || (OutdoorCamera::Project(v43), v45 = sr_4254D2(v44), (v12->uNumVertices = v45) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 v47 = (char *)&array_508690[0].vWorldViewProjY;
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 LODWORD(v61) = *((int *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 v48 = v61 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 v65 = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 dword_50B638[v46] = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 LODWORD(v58) = *(int *)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 v49 = v58 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 v59 = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 v47 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 dword_50B570[v46++] = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441 while ( v46 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 v50 = sr_4254D2(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 v12->uNumVertices = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 sr_sub_4829B9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 &array_73D150[*(char *)(v3 + 298)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452 &array_73D150[*(char *)(v3 + 299)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 &array_73D150[*(char *)(v3 + 300)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 v52 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 LODWORD(v62) = *((int *)v52 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 v53 = v62 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 v60 = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 dword_50B638[v51] = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 LODWORD(v72) = *(int *)v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 v54 = v72 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 v70 = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469 v52 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 dword_50B570[v51++] = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472 while ( v51 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476 sr_sub_486B4E_push_outdoor_edges(array_508690, dword_50B638, dword_50B570, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480 v1 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 v3 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 if ( v79 >= v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491 // 73C830: using guessed type char static_sub_004789DE_byte_73C830__init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493 //----- (00479089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494 bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496 BSPModel *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7497 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7498 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7499 int v5; // ST28_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7500 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7501 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7502 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7503 int v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504 int v10; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505 signed int v11; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 int v12; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7507 bool result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7508 unsigned int v14; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7509 int v15; // [sp+Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7510 int *v16; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7511 int v17; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 int v18; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 int v19; // [sp+20h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 int angle; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 int v21; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 int v22; // [sp+28h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 v16 = unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519 angle = (signed int)(pOutdoorCamera->uCameraFovInDegrees << 11) / 360 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 v14 = uModelID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 v2 = &pOutdoor->pBModels[uModelID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 v3 = v2->vBoundingCenter.x - pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 v4 = v2->vBoundingCenter.y - pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 v5 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 v21 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 v18 = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 v17 = v3 * v5 + v4 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 v17 = (unsigned __int64)(v17 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 v19 = v4 * v6 - v3 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 v7 = abs(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 v8 = abs(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535 v9 = sub_4621DA(v8, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 v10 = v14 * 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 v22 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 *v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 if ( v9 < pOutdoor->pBModels[v14].sBoundingRadius + 256 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 *v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 v15 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 if ( v19 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 v11 = ((unsigned __int64)(v15 * (signed __int64)v17) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544 - ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7546 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7547 + ((unsigned __int64)(v15 * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 v12 = v11 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7549 if ( v22 <= pOutdoorCamera->shading_dist_mist + 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7551 if ( abs(v12) > *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v10) + 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7553 result = v12 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7554 LOBYTE(result) = v12 >= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7556 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7558 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7563 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7567
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7569
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7570
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7571 //----- (00479295) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7572 int stru148::_479295()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7574 stru148 *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7575 ODMFace *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7576 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7577 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7578 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7579 int v6; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7580 int v7; // ST04_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7581 stru149 *v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7582 Vec3_int_ thisa; // [sp+Ch] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7583 int v11; // [sp+18h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7585 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7586 v2 = this->pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7587 if ( !v2->pFacePlane.vNormal.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 v3 = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7590 v4 = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7592 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7593 v11 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7594 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7596 if ( (v2->pFacePlane.vNormal.x || v2->pFacePlane.vNormal.y) && abs(v2->pFacePlane.vNormal.z) < 59082 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7598 thisa.x = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599 thisa.y = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7600 thisa.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7601 thisa.Normalize_float();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7602 v4 = thisa.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7603 v3 = thisa.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7604 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7606 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7607 v4 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7608 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7609 v5 = -65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7610 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7611 v6 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 v1->sTextureDeltaU = v2->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7614 v8 = v1->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7615 v1->sTextureDeltaV = v2->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 v8->_48616B(v4, v7, 0, 0, v5, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7617 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7619
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7620 //----- (00479332) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621 int Render::OnOutdoorRedrawSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7624 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7625 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7626 char v3; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7627 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7628 float v5; // ST34_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7629 double v6; // ST24_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7630 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7631 unsigned int v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7632 signed int v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7633 Vec3_float_ *v10; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7634 double v11; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7635 float v12; // ST34_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 double v13; // ST1C_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 float v14; // [sp+4h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7638 float v15; // [sp+8h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7639 float v16; // [sp+Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7641 v14 = (double)pOutdoor->vSunlight.x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 v1 = (unsigned int)&array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 v15 = (double)pOutdoor->vSunlight.y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7645 v16 = (double)pOutdoor->vSunlight.z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 if ( v1 > (unsigned int)array_77EC08 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7648 v2 = (char *)&array_77EC08[0].pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7651 v3 = v2[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7652 if ( v3 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7653 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7656 v9 = pTerrainNormalIndices[((*((int *)v2 - 9) >> 15) & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7657 + 2 * ((unsigned __int8)v2[9] + ((unsigned __int8)v2[8] << 7))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7658 if ( v9 > (signed int)(uNumTerrainNormals - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661 v10 = &pTerrainNormals[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7662 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7664 v11 = -(v16 * v10->z + v15 * v10->y + v14 * v10->x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7665 if ( v11 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7666 v11 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 v12 = v11 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 v13 = v12 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 v2[4] = 31 - LOBYTE(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7675 if ( v2[4] < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7676 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7677 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7680 v2 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7681 if ( (unsigned int)(v2 - 84) >= v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7682 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 v4 = (double)(signed int)(((unsigned __int64)(**(int **)v2 * (signed __int64)-pOutdoor->vSunlight.x) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 + ((unsigned __int64)(*(int *)(*(int *)v2 + 4) * (signed __int64)-pOutdoor->vSunlight.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 + ((unsigned __int64)(*(int *)(*(int *)v2 + 8) * (signed __int64)-pOutdoor->vSunlight.z) >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7688 if ( v4 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 v4 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 v5 = v4 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7691 v6 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7692 v7 = (int)(v2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7693 v2[4] = 31 - LOBYTE(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7694 if ( (char)(31 - LOBYTE(v6)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7695 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 if ( *(char *)v7 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 *(char *)v7 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 if ( *(char *)(*(int *)v2 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 v8 = pTextureFrameTable->GetFrameTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 *((short *)v2 - 4),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 *((int *)v2 - 6) = v8 != -1 ? (int)&pBitmaps_LOD->pTextures[v8] : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712 //----- (00479543) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713 void Render::DrawSkyD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 double v2; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 double v3; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 double v4; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 double v5; // st4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7721 double v6; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 char *v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 int v8; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 int v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 int v10; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 signed __int64 v11; // qax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 double v12; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7728 int v13; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729 int v14; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 int v15; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 int v16; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7732 signed __int64 v17; // qtt@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7733 signed int v18; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7734 Texture *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 double v20; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7736 double v21; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 double v22; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 unsigned __int8 v23; // sf@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7739 unsigned __int8 v24; // of@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7740 stru148 _this; // [sp+14h] [bp-150h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 double v26; // [sp+120h] [bp-44h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7742 float v27; // [sp+128h] [bp-3Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7743 float v28; // [sp+12Ch] [bp-38h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7744 int v29; // [sp+130h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7745 int v30; // [sp+134h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 int v31; // [sp+138h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7747 int v32; // [sp+13Ch] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7748 int v33; // [sp+140h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7749 float v34; // [sp+144h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7750 int v35; // [sp+148h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7751 double v36; // [sp+14Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 int v37; // [sp+154h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7753 int v38; // [sp+158h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7754 int v39; // [sp+15Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7755 int v40; // [sp+160h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 v30 = (signed __int64)((double)(pOutdoorCamera->int_fov_rad * pIndoorCamera->pos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758 / ((double)pOutdoorCamera->int_fov_rad + 8192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 + (double)pViewport->uScreenCenterY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 v34 = cos((double)pIndoorCamera->sRotationX * 0.0030664064) * (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 v38 = (signed __int64)((double)pViewport->uScreenCenterY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 - (double)pOutdoorCamera->int_fov_rad
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 / (v34 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 * (sin((double)pIndoorCamera->sRotationX * 0.0030664064)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 * (double)-pOutdoorCamera->shading_dist_mist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 - (double)pIndoorCamera->pos.z));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 _this._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 _this.ptr_38->_48694B();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 _this.uTileBitmapID = LOWORD(pOutdoor->uSky_TextureID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770 _this.pTexture = (Texture *)(SLOWORD(pOutdoor->uSky_TextureID) != -1 ? (int)&pBitmaps_LOD->pTextures[SLOWORD(pOutdoor->uSky_TextureID)] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7771 if ( _this.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7773 v0 = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 _this.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 _this.uNumVertices = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 _this.v_18.x = -stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 _this.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 v1 = stru_5C6E00->SinCos(v0 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7779 v2 = (double)(signed int)pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 _this.v_18.z = -v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 array_50AC10[0].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 v3 = (double)(signed int)pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7783 array_50AC10[0].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7784 array_50AC10[1].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7785 v4 = (double)v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786 _this.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787 _this.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788 v28 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789 array_50AC10[1].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 v5 = (double)(signed int)pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7791 array_50AC10[2].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 v38 = pViewport->uViewportZ - pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 _this.field_24 = 0x2000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794 array_50AC10[2].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795 array_50AC10[3].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796 array_50AC10[3].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797 v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798 v6 = tan(0.6457717418670654);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 v33 = 65536 / (signed int)(signed __int64)(v36 / v6 + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 if ( (signed int)_this.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 v7 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 LODWORD(v27) = *(int *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7807 v26 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7808 v29 = LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7809 v38 = _this.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7810 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7811 v8 = v39 + _this.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 v39 = v33 * (v30 - LODWORD(v26));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813 v35 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814 v38 = _this.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7816 HIDWORD(v36) = v39 + _this.ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 v38 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 v9 = (unsigned __int64)(_this.v_18.z * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 v10 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 v39 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 if ( _this.v_18.x + v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 v11 = (signed __int64)*((float *)v7 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 v38 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 v12 = *(float *)v7 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 v13 = v33 * (pViewport->uScreenCenterX - v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 LODWORD(v34) = -_this.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 v32 = (signed __int64)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 v14 = v33 * (v30 - v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7835 v40 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 v37 = abs(SLODWORD(v34) >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 v15 = abs(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 if ( v37 <= v15 || v32 <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 if ( v39 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 v14 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 v37 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 v16 = (unsigned __int64)(_this.v_18.z * (signed __int64)v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 v14 += v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 v10 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 v39 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 v38 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7855 LODWORD(v17) = LODWORD(v34) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 HIDWORD(v17) = SLODWORD(v34) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7857 v40 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 v18 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 if ( v18 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 v18 = pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 v37 = _this.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 v37 = v35 + ((unsigned __int64)(v37 * (signed __int64)v13) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 v35 = _this.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 HIDWORD(v36) += (unsigned __int64)(v35 * (signed __int64)v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 + ((signed int)((unsigned __int64)(v37 * (signed __int64)v18) >> 16) >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 v40 = (unsigned __int64)(SHIDWORD(v36) * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 v19 = _this.pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 HIDWORD(v36) = _this.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 v7 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873 v20 = (double)SHIDWORD(v36) * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7874 HIDWORD(v36) = 224 * pMiscTimer->uTotalGameTimeElapsed + (v40 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7876 *((float *)v7 - 10) = (double)v35 / v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7877 v21 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7878 HIDWORD(v36) = v19->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7879 v22 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 HIDWORD(v36) = v18 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 v24 = __OFSUB__(v31, _this.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 v23 = ((v31 - _this.uNumVertices) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883 *((float *)v7 - 9) = v21 / (v22 * 65536.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884 *((float *)v7 - 16) = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 *((float *)v7 - 11) = 1.0 / (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7886 if ( !(v23 ^ v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7892 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 array_50AC10[0].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7895 array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7896 array_50AC10[3].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7897 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7898 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7900 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7901 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7903 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908 //----- (00479A53) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909 void __fastcall sub_479A53(unsigned int uNumVertices, unsigned int uFaceID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7911 BLVFace *pFace; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 PolygonType v4; // al@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7915 signed __int64 v6; // qax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 PolygonType v7; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 int v8; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 int v9; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7919 unsigned int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7920 double v11; // st6@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 int v12; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7922 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 char *v14; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 void *v15; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 int v16; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 int v17; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 double v18; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 signed int v19; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 void *v20; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 int v21; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 int v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 signed __int64 v23; // qtt@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933 double v24; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 unsigned __int8 v25; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935 unsigned __int8 v26; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 Render *v27; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 double v28; // st7@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938 char *v29; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939 char *v30; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 unsigned __int8 v31; // c0@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 unsigned __int8 v32; // c3@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 double v33; // st6@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 char *v34; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 const void *v35; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 int v36; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 const void *v37; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 signed __int64 v38; // qax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 int v39; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949 int v40; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 int v41; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951 signed __int64 v42; // qtt@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 int v43; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953 char v44; // zf@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 double v45; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 double v46; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 unsigned int v47; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957 double v48; // st7@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 RenderVertexSoft *v49; // ebx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959 void *v50; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 double v51; // st7@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 RenderVertexSoft *v52; // edx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962 void *v53; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 char *v54; // ebx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 unsigned int v55; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 unsigned int v56; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 int v57; // ST10_4@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 Texture *v58; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968 signed int v59; // [sp-4h] [bp-178h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7969 stru148 *v60; // [sp+0h] [bp-174h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7970 IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 stru148 v62; // [sp+14h] [bp-160h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 unsigned int v63; // [sp+120h] [bp-54h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 double v64; // [sp+124h] [bp-50h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974 unsigned int v65; // [sp+128h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7975 unsigned int v66; // [sp+12Ch] [bp-48h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7976 float v67; // [sp+130h] [bp-44h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7977 __int64 v68; // [sp+134h] [bp-40h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7978 __int64 v69; // [sp+13Ch] [bp-38h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979 int v70; // [sp+144h] [bp-30h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980 int X; // [sp+148h] [bp-2Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 int v72; // [sp+14Ch] [bp-28h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7982 float v73; // [sp+150h] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7983 unsigned int v74; // [sp+154h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7984 RenderVertexSoft *v75; // [sp+158h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7985 float v76; // [sp+15Ch] [bp-18h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 int v77; // [sp+160h] [bp-14h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 int v78; // [sp+164h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 void *v79; // [sp+168h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 float v80; // [sp+16Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 const void *v81; // [sp+170h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 pFace = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993 v65 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 v3 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 v4 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 if ( v4 == POLYGON_InBetweenFloorAndWall || v4 == POLYGON_Floor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 v54 = (char *)&array_507D30[0].u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 LODWORD(v80) = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 v69 = (GetTickCount() >> 5) - pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 *(float *)v54 = (double)v69 + *(float *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 *(float *)v54 = *(float *)v54 * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 v55 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 v54 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 v44 = LODWORD(v80)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 v68 = pBLVRenderParams->vPartyPos.y + (v55 >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 *((float *)v54 - 11) = ((double)v68 + *((float *)v54 - 11)) * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 uFaceID = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 v56 = 8 * uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 LOBYTE(v56) = 8 * uFaceID | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 v57 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8019 v58 = pFace->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8020 pRenderer->DrawIndoorPolygon(v3, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], v58, v57, -1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8021 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 HIDWORD(v69) = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 HIDWORD(v68) = pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 *(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 v70 = (signed __int64)((double)(pBLVRenderParams->field_40 * pBLVRenderParams->vPartyPos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 / (((double)pBLVRenderParams->field_40 + 16192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 * 65536.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 + *(float *)&v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 v5 = (double)pIndoorCamera->sRotationX * 0.0030664064;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 *(float *)&v75 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8032 v80 = cos(v5) * 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 v6 = (signed __int64)(*(float *)&v74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 - (double)pBLVRenderParams->field_40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8035 / ((v80 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8036 * 65535.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8037 * (sin(*(float *)&v75) * -16192.0 - (double)SHIDWORD(v68)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8038 v7 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 if ( v7 == 4 || v7 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8040 v70 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8041 stru_8019C8._48653D(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8042 v62._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8043 v62.uTileBitmapID = pFace->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 v62.pTexture = (Texture *)((signed __int16)v62.uTileBitmapID != -1 ? (int)&pBitmaps_LOD->pTextures[(signed __int16)v62.uTileBitmapID] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 if ( !v62.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 v8 = pBLVRenderParams->sPartyRotX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 v62.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 v62.uNumVertices = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 v62.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052 v62.v_18.x = -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8053 v62.v_18.z = -stru_5C6E00->SinCos(v8 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 memcpy(&array_507D30[v3], array_507D30, sizeof(array_507D30[v3]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 LODWORD(v80) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 v62.field_24 = 33554432;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 v64 = (double)(signed int)v10 * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 LODWORD(v80) = v62.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 v11 = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 LODWORD(v80) = v62.pTexture->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 v12 = v62.pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 v13 = v62.pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 v67 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 *((float *)&v68 + 1) = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 if ( (signed int)v62.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 v59 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 v14 = (char *)&array_507D30[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 v15 = (void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v14));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 LODWORD(v80) = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 v16 = v77 + v62.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 v77 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 v74 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 LODWORD(v80) = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091 v79 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 v75 = (RenderVertexSoft *)(v77 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v15) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 v17 = v72 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v14 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 v18 = *(float *)v14 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 v19 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 v77 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099 X = (int)((char *)v79 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 LODWORD(v76) = (signed __int64)v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 v20 = (void *)(v72 * (v70 - LODWORD(v76)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 v79 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 v21 = abs(v19 >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 if ( v21 <= abs(X) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 v19 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 v20 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 v22 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119 v20 = (char *)v20 + v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120 X = v22 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 LODWORD(v23) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 HIDWORD(v23) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127 v79 = (void *)(v23 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 LODWORD(v80) = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 LODWORD(v76) = v74 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 LODWORD(v80) = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 v77 = (unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 LODWORD(v73) = (unsigned __int64)((signed int)v75 * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 v14 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 LODWORD(v80) = v66 + ((signed int)((unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 v81 = (char *)v81 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 v24 = (double)SLODWORD(v80) * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 LODWORD(v80) = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 v26 = __OFSUB__((int)v81, v62.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 v25 = (signed int)((char *)v81 - v62.uNumVertices) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 *((float *)v14 - 10) = v24 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 *((float *)v14 - 9) = (double)SLODWORD(v80) * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 *((float *)v14 - 11) = 65536.0 / (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 if ( !(v25 ^ v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 LODWORD(v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 v80 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 if ( (signed int)v62.uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 v28 = (double)SLODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 LODWORD(v76) = (int)(char *)array_50AC10 + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 v29 = (char *)&array_50AC10[0].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 v30 = (char *)&array_507D30[1].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 v79 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 v81 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 v78 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 v31 = v28 < *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 v32 = v28 == *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 memcpy(v79, v81, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 if ( v31 | v32 || v28 >= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 if ( v28 >= *((float *)v30 - 12) || v28 <= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 v33 = (*((float *)v30 - 1) - *((float *)v30 - 13)) * v28 / (*(float *)v30 - *((float *)v30 - 12))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 + *((float *)v30 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 v33 = (*((float *)v30 - 13) - *((float *)v30 - 1)) * v28 / (*((float *)v30 - 12) - *(float *)v30)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 + *((float *)v30 - 13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 *(float *)v29 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 *(unsigned int *)LODWORD(v76) = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8191 v81 = (char *)v81 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 v30 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 if ( SLODWORD(v73) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 v34 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 v65 = v77 >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 HIDWORD(v69) = LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v34));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 v78 = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 v36 = (int)((char *)v81 + v62.ptr_38->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 v81 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 v74 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 v78 = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8212 v78 = (int)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 v75 = (RenderVertexSoft *)((char *)v81 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 v81 = (const void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 v78 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 v37 = (const void *)(v72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v34 - 1)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 v38 = (signed __int64)(*(float *)v34 - 1.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 LODWORD(v76) = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 v39 = v72 * (v70 - v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 v78 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 v40 = abs(X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 if ( abs((signed __int64)v65) <= v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 v39 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 v78 = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 v41 = (unsigned __int64)(v62.v_18.z * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 v39 += v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 X = v41 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 v81 = (const void *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 if ( v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 v79 = (void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 v78 = 2 * LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 v81 = (const void *)((unsigned __int64)(v62.v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 * (signed __int64)(signed int)(signed __int64)(((double)v70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 - ((double)(2 * LODWORD(v76))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248 - *(float *)v34))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 * (double)v72)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 X = (int)((char *)v81 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252 LODWORD(v42) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 HIDWORD(v42) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 v79 = (void *)(v42 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 v81 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 v78 = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 v43 = v74 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 v74 = (unsigned int)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 LODWORD(v76) = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 v78 = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 v74 = (unsigned __int64)(v43 * v42 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 v34 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 v78 = v66 + ((signed int)v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 v44 = HIDWORD(v69)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 v45 = (double)v78 * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 v78 = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v42 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 *((float *)v34 - 10) = v45 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 *((float *)v34 - 9) = (double)v78 * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272 v46 = (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 *((float *)v34 - 16) = 0.000015258789 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 *((float *)v34 - 11) = 65536.0 / v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 if ( SLODWORD(v73) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8281 v48 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8282 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8283 v49 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 HIDWORD(v69) = LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8287 if ( v48 >= v49->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8289 v50 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 ++v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 memcpy(v50, v49, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 --HIDWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 while ( HIDWORD(v69) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8299 v62.uNumVertices = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 *(float *)&v74 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 if ( SLODWORD(v73) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 v51 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 v52 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307 v80 = v73;
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 if ( v51 <= v52->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 v53 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315 memcpy(v53, v52, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318 --LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8320 while ( v80 != 0.0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 v62.uNumVertices = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325 v59 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328 v27->_4A2ED5(v59, v60, v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331 //----- (0047A384) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332 void ODM_LoadAndInitialize(const char *pLevelFilename, OutdoorCamera *thisa)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334 int v2; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335 unsigned int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336 MapInfo *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 SpawnPointMM7 *v6; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 size_t v7; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 char *v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342 char Source[120]; // [sp+Ch] [bp-84h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343 const char *pFilename; // [sp+84h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344 unsigned int v12; // [sp+88h] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 int v13; // [sp+8Ch] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 pFilename = pLevelFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348 thisa->AllocSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 pOutdoorCamera->_485F64();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350 pWeather->bRenderSnow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 thisa = (OutdoorCamera *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 GetAlertStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 if ( qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 qword_A750D8 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 v2 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 v4 = &pMapStats->pInfos[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 v3 = v4->uRespawnIntervalDays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365 v4 = (MapInfo *)thisa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 day_attrib &= 0xFFFFFFFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 dword_6BE13C_uCurrentlyLoadedLocationID = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 pOutdoor->Initialize(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 pFilename,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8371 (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 (int)&thisa);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 UpdateActors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 UpdateLayingItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 BYTE1(dword_6BE364_game_settings_1) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 thisa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 if ( thisa == (OutdoorCamera *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 if ( (signed int)pOutdoor->uNumSpawnPoints > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 v6 = &pOutdoor->pSpawnPoints[v12 / 0x18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8392 if ( pOutdoor->pSpawnPoints[v12 / 0x18].uKind == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 SpawnEncounter(v4, v6, v5, v5, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395 v4->SpawnRandomTreasure(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 v12 += 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8398 if ( v13 >= (signed int)pOutdoor->uNumSpawnPoints )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8403 RespawnGlobalDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 pOutdoor->PrepareDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 pOutdoor->_47F223_LooksLikeGenerateMonsterLoot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 pOutdoor->InitalizeActors(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 pOutdoor->MessWithLUN();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 v7 = strlen("levels\\");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 strcpy(Source, &pFilename[v7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8411 strcpy(pOutdoor->pLevelFilename, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8412 pWeather->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 pIndoorCamera->sRotationY = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 pIndoorCamera->sRotationX = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 pOutdoorCamera->RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416 pOutdoor->UpdateSunlightVectors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8417 pOutdoorCamera->int_fov_rad = (signed __int64)pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8418 pOutdoorCamera->int_fov_rad_inv = (signed __int64)pIndoorCamera->flt_20_inv_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8419 v8 = (char *)&array_77EC08[0].ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8422 *(int *)v8 = (int)&stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423 v8 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 while ( (signed int)v8 < (signed int)&unk_801A00 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 v9 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 *((int *)v9 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430 *(int *)v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 *((int *)v9 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8432 v9 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 while ( (signed int)v9 < (signed int)&unk_801A0C );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8438
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8439
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8440 //----- (0047A825) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8441 bool LevelDecoration::_47A825()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 bool v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 LevelDecoration *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8445
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448 if ( pParty->uCurrentHour >= 1 || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 178) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 164)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 165)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 166)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 167)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 168)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 169)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 170)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8461 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 171)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8462 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 172)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 173)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 174)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 175)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8466 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 176)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8467 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 177) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8470 LOBYTE(v2->field_2) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8474 LOBYTE(v2->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8477
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480 //----- (0047BC6F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481 unsigned __int16 *__fastcall GetBillboardPalette(RenderBillboard *a1, int a2, signed int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 int v6; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 signed int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 signed __int64 v9; // qtt@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8488 signed int v10; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8489 int v11; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490 signed __int64 v12; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8491 double v13; // ST10_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492 int v14; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 signed int v15; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8494 signed __int64 v16; // qtt@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 signed int v17; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 int v18; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497 float a3a; // [sp+20h] [bp+8h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8498
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 return PaletteManager::Get(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 if ( !pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 v14 = day_fogrange_1 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508 if ( a3 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8510 if ( a3 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 LODWORD(v16) = (a3 - v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 HIDWORD(v16) = (a3 - v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 v15 = (unsigned __int64)(27 * v16 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518 v15 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8521 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 v17 = sub_43F55F(a1, v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 if ( v17 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8527 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 if ( !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 v7 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 v11 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 if ( a4 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537 LODWORD(v12) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 HIDWORD(v12) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 a3a = (double)(signed int)(((unsigned __int64)(11 * v12 / (pOutdoorCamera->shading_dist_shade << 16)) >> 16) + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 v13 = a3a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 v10 = sub_43F55F(a1, LODWORD(v13) + v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 if ( v10 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8544 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 if ( v10 < a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 v10 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 if ( v10 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 v10 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8549 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 if ( pWeather->field_FA0 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 v8 = 67108864;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8555 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 v8 = pParty->pPartyBuffs[16].uPower << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 if ( a3 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 if ( a3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561 LODWORD(v9) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562 HIDWORD(v9) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563 v6 = (unsigned __int64)(27 * v9 / v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568 v6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8570 v10 = sub_43F55F(a1, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571 if ( v10 > 27 || !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8572 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8576 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589 //----- (0047BEB1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590 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
8591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 stru148 *v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8593 signed int v9; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 int v10; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 signed int v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596 signed int v12; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 signed __int64 v13; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 int *v14; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599 int *v15; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 int v16; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 signed __int64 v17; // qtt@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 double v18; // ST10_8@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 double v19; // ST10_8@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604 int v20; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 int result; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 int *v22; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 signed int v23; // edx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 signed __int64 v24; // qtt@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 int v25; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 signed int v26; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 float v27; // [sp+28h] [bp+10h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612 float v28; // [sp+28h] [bp+10h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 int v29; // [sp+2Ch] [bp+14h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 v8 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616 v9 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 *(char *)a8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628 if ( a1 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 v26 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 v9 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 v10 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 if ( !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 v14 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641 v15 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8644 *a5 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8645 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8647 v16 = v8->field_58 - terrain_gamma;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8648 if ( v16 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8650 if ( v16 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8651 v16 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8653 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8654 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8655 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8657 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8658 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8660 v28 = pOutdoor->fFogDensity * 27.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8661 v19 = v28 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8662 v29 = LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 LODWORD(v17) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 HIDWORD(v17) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 v27 = (double)(signed int)(((unsigned __int64)(v17 / (pOutdoorCamera->shading_dist_shade << 16) * (31 - *a6)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669 + *a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 v18 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 v29 = LODWORD(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 *v14 = v16 + v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 v20 = *v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 if ( v16 + v29 > v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 *v14 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678 if ( *v14 < v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 *v14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 if ( *v14 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 *v14 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8682 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8684 if ( v9 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8686 if ( v9 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 v23 = v9 - (day_fogrange_1 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 LODWORD(v24) = v23 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690 HIDWORD(v24) = v23 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691 v25 = (unsigned __int64)(27 * v24 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 *a5 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 if ( v25 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8695 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707 *a5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 *v22 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714 *a6 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719 *v22 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 if ( v10 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8725 if ( byte_4D864C && BYTE1(pGame->uFlags) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8729 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8731 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8733 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8734 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736 v11 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738 v12 = v11 << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8740 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8741 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8742 if ( v9 <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 if ( v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8746 LODWORD(v13) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 HIDWORD(v13) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8748 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8749 *a5 = (unsigned __int64)(27 * v13 / v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8751 if ( *a5 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 if ( v8->field_32 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8762 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8770 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8772 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8773 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8774 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8775 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8776 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8777 *(char *)a8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8778 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8779 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8780 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8781 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8782 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8783 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8784 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8785
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786 //----- (0047C178) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8787 void *__fastcall sr_sub_47C178(signed int a1, stru148 *a2, int terrain_gamma, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8789 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8790 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8791 int v6; // [sp+4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8792 int v7; // [sp+8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8793
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8794 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8795 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8796 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8797 result = PaletteManager::Get(a2->pTexture->palette_id2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8799 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8801 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
8802 result = sr_sub_47C1CA(v4, SBYTE3(a4), v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8804 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8807 //----- (0047C1CA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8808 void *__fastcall sr_sub_47C1CA(stru148 *a1, char a2, int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8810 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8811 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8812 int v6; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8813 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8814 int a3a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8818 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8821 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8822 result = PaletteManager::Get(a1->pTexture->palette_id2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8824 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 v6 = pGame->_44EC23(a1, &a3a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 if ( v6 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8828 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8829 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8831 if ( v6 != -1 || a4 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8833 v7 = v4->pTexture->palette_id2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8835 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8837 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 result = PaletteManager::Get_Mist_or_Red_LUT(v7, v6, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8843 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8844 result = PaletteManager::Get_Dark_or_Red_LUT(v4->pTexture->palette_id2, v6, a3a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8847 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8849
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8850 //----- (0047C24C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8851 unsigned __int16 *__fastcall sr_sub_47C24C_get_palette(BLVFace *a1, int a2, int a3, char a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8855 int a3a; // [sp+4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8856
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8857 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8858 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8859 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8861 v5 = pGame->_44ED0A(a1, &a3a, 31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8862 if ( v5 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 a3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8865 return PaletteManager::Get_Dark_or_Red_LUT(v4, a3, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8868 //----- (0047C28C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869 char *__fastcall sr_sub_47C28C_get_palette(stru148 *a1, char a2, signed int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8872 char *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8873 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8874 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8875 int a2a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8878 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8879 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 a2a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8882 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8883 result = (char *)pPaletteManager->field_199600_palettes[a1->pTexture->palette_id2];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8885 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887 v6 = pGame->_44EC23(a1, &a2a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 a3 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8892 if ( a3 != -1 || a4 != -1 )
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8893 v7 = v4->pTexture->palette_id2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8895 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 result = (char *)PaletteManager::_47C30E_get_palette(v7, a2a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8899 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8900 result = (char *)PaletteManager::_47C33F_get_palette(v4->pTexture->palette_id2, a2a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8901 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8907
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8908
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909 //----- (0047C370) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910 unsigned int __cdecl GetLevelFogColor()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8912 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8913 signed __int64 v1; // qax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8914 int v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8915
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8916 if ( bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918 result = 0xFF258F5Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8920 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8922 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 if ( pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8926 v2 = -(pWeather->field_FA0 != 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8927 result = (v2 & 0xE0E0E1) - 0xE0E0E1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8929 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931 v1 = (signed __int64)((1.0 - pOutdoor->fFogDensity) * 200.0 + pOutdoor->fFogDensity * 31.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932 result = v1 | (((unsigned int)v1 | (((unsigned int)v1 | 0xFFFFFF00) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8935 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8937 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8940 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8942 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8943 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8944
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8945 //----- (0047C3D7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8946 int __fastcall sub_47C3D7_get_fog_related_stuff(int a1, int a2, float a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8947 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8948 int v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8949 double v5; // st7@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8950 signed int v6; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8951 signed int v7; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952 double v8; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8953 double v9; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8954 double v10; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 float v11; // ST14_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8956 double v12; // ST08_8@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8957
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8958 v3 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8959 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8960 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8961 if ( pParty->field_1613C || !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8962 return 0xFF000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8963 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8965 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8966 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 v5 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8968 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 if ( a3 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8970 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8971 v8 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 if ( a3 > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978 v7 = (signed __int64)((a3 - v5) / (v8 - v5) * 216.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 v9 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 if ( a3 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990 v10 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991 if ( a3 > v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 v11 = (a3 - v9) * 216.0 / (v10 - v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 v7 = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 if ( v7 > v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9006 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9007 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9008 v7 = 248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9009 return (-1 - v7) << 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9011 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9012 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9013 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9014 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9015
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9016 //----- (0047C4FC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9017 signed int __fastcall GetActorTintColor(int a1, int a2, float a3, int a4, RenderBillboard *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9019 int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9020 signed int v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9021 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9022 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9023 double v9; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9024 double v10; // ST0C_8@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9025 int v11; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9026 signed int v12; // edi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9027 double v13; // ST0C_8@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9028 double v14; // ST0C_8@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9029 double v15; // st7@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9030 double v16; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9031 double v17; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9032 int v18; // ST14_4@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9033 double v19; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9034 signed int v20; // [sp+10h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9035 float a3a; // [sp+1Ch] [bp+8h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9036 float a3b; // [sp+1Ch] [bp+8h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9037 float a3c; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9038 float a3d; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9039 float a4b; // [sp+20h] [bp+Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9040 int a4a; // [sp+20h] [bp+Ch]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9041 float a4c; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9042 float a4d; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9043 int a5a; // [sp+24h] [bp+10h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9044
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9045 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9046 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9047 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9048 return 8 * (31 - a1) | ((8 * (31 - a1) | ((31 - a1) << 11)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9049 v8 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9050 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9051 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9052 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9053 return 16711680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9054 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9056 if ( v8 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9057 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9058 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9059 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9060 v20 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9061 v9 = (double)v20 * 1024.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9062 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9063 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9064 if ( a3 <= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9066 if ( a3 > 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9068 a4b = a3 * 216.0 / v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9069 v10 = a4b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9070 v6 = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9071 if ( SLODWORD(v10) > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9072 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9075 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9077 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9079 if ( a3 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9080 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9081 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9082 if ( a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9083 v6 = 8 * sub_43F55F(a5, v6 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9084 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9085 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9086 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9088 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9089 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9090 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9091 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9092 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9094 result = (signed int)0xF8F8F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9096 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9098 v11 = 8 * (a1 - v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9099 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9100 if ( v11 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9102 if ( v11 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9103 v12 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9105 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9107 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9109 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9111 a3b = pOutdoor->fFogDensity * 216.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9112 v14 = a3b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9113 a4a = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9115 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9117 a3a = (a3 / (double)pOutdoorCamera->shading_dist_shade * 32.0 + 216.0) * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118 v13 = a3a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119 a4a = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121 v6 = a4a + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122 if ( a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 v6 = 8 * sub_43F55F(a5, v6 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9125 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126 if ( v6 < v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127 v6 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128 if ( v6 > 8 * pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129 v6 = 8 * pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 if ( !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132 v15 = (double)(255 - v6) * 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133 a3c = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134 a4c = v15 * 16.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135 v16 = a4c + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136 a5a = LODWORD(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 a4d = a3c * 194.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 v17 = a4d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 v18 = LODWORD(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 a3d = a3c * 153.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 v19 = a3d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142 result = LODWORD(v19) | ((v18 | (a5a << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151 //----- (0047F44B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152 int __stdcall WorldPosToGridCellX(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154 return (a1 >> 9) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 //----- (0047F458) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159 int __stdcall WorldPosToGridCellZ(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9161 return 64 - (a1 >> 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9163 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 //----- (0047F469) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166 int __stdcall GridCellToWorldPosX(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 return (a1 - 64) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170 // 47F469: using guessed type int __stdcall GridCellToWorldPosX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172 //----- (0047F476) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173 int __stdcall GridCellToWorldPosZ(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 return (64 - a1) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 // 47F476: using guessed type int __stdcall GridCellToWorldPosZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 //----- (0047F4D3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180 void __fastcall sub_47F4D3(int band1, int band2, int band3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 stru220 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184 double v5; // ST2C_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 double v6; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 double v7; // [sp+18h] [bp-28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 double v8; // [sp+20h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 int v9; // [sp+34h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189 int v10; // [sp+38h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 signed int band3a; // [sp+48h] [bp+8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 v9 = band2 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193 pOutdoorCamera->outdoor_grid_band_3 = band3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 v10 = band1 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 v3 = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196 pOutdoorCamera->uPickDepth = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 v4 = stru_76E5C8; // v4: 0 -> 65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 band3a = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201 v8 = (double)(signed int)((char *)v4 + 256 - (int)stru_76E5C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202 do // band3a: 0 -> 128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 v5 = pow((double)band3a, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 v6 = pow(v8, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206 *((float *)&v5 + 1) = sqrt(v6 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207 v7 = *((float *)&v5 + 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208 if ( SLODWORD(v7) >= v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 if ( SLODWORD(v7) >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211 v4->field_0 = ((SLODWORD(v7) >= v3) - 1) & 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213 v4->field_0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217 v4->field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 band3a += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 v4->distance = LOWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223 while ( band3a < 65792 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225 while ( (signed int)v4 < (signed int)arary_77E5C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9231 //----- (004811A3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232 void stru148::_4811A3()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236 pBitmaps_LOD->pHardwareTextures[pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid]],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 pBitmaps_LOD->pHardwareTextures[uTileBitmapID],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242 1, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247 //----- (00481DB2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248 char __fastcall sr_sub_481DB2(RenderVertexSoft *a1, signed int a2, stru148 *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 signed int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 char *v6; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254 double v7; // ST14_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255 double v8; // ST0C_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 char result; // al@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 if ( a2 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260 v3 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 v4 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 a3->ptr_38 = &stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263 a3->pTexture = (Texture *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265 if ( (signed int)a3->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 v6 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270 v7 = *((float *)v6 - 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271 dword_50B638[v5] = LODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272 v8 = *(float *)v6 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 v6 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 dword_50B570[v5++] = LODWORD(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276 while ( v5 < (signed int)a3->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278 result = sr_sub_486B4E_push_outdoor_edges(a1, dword_50B638, dword_50B570, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287 //----- (00481E55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288 void OutdoorCamera::Project(unsigned int uNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 double v1; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 double v2; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292 double v3; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294 unsigned int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 double v6; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 double v7; // st3@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 v1 = (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 v2 = (double)pViewport->uScreenCenterX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 v3 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 v5 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307 v6 = v1 * array_507D30[v4].flt_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 v7 = v6 * array_507D30[v4].vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309 memcpy(&array_50AC10[v4], &array_507D30[v4], sizeof(array_50AC10[v4]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310 array_50AC10[v4].vWorldViewProjX = v2 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 array_50AC10[v4].vWorldViewProjY = v3 - v6 * array_507D30[v4].vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 while ( v5 );
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 //----- (00481EB7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320 void __cdecl ResetStru148s()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322 int v0; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9323 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325 v0 = pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326 if ( pOutdoorCamera->numStru148s > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9328 v1 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331 *((int *)v1 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 *(int *)v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333 *((int *)v1 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9334 v1 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337 while ( v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 //----- (00481ED9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342 void __cdecl sub_481ED9_MessWithOutdoorCamera()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9344 stru_8019C8._48616B(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9345 pOutdoorCamera->numStru148s = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 pOutdoorCamera->uNumEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347 pOutdoorCamera->uNumSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 pOutdoorCamera->uNumSurfs = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349 pOutdoorCamera->field_3C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 pOutdoorCamera->field_44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353 //----- (00481EFA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354 bool __fastcall sub_481EFA(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, RenderVertexSoft *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356 RenderVertexSoft *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357 RenderVertexSoft *v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358 bool v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 bool v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 bool v9; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 bool v10; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362 double v11; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 signed int v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 signed int v13; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 signed int v14; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 signed int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 RenderVertexSoft *v17; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370 v6 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 v17 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 v7 = a1->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373 v8 = v5->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 v9 = a3->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 v10 = a4->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 return !(v8 & v9 & v10 & v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377 && ((v11 = (double)pOutdoorCamera->shading_dist_mist, v11 > v6->vWorldViewPosition.x) ? (v12 = 0) : (v12 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 v11 > v17->vWorldViewPosition.x ? (v13 = 0) : (v13 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379 v11 > a3->vWorldViewPosition.x ? (v14 = 0) : (v14 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 v11 > a4->vWorldViewPosition.x ? (v15 = 0) : (v15 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 !(v13 & v14 & v15 & v12));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 //----- (00481FC9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385 int __fastcall sub_481FC9(RenderVertexSoft *_ECX, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 /*signed int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 __int64 v11; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 __int64 v12; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 __int64 v13; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 __int64 v14; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 __asm { fld dword ptr [ecx+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396 _ESI = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 _EDX = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 __asm { fcomp dword ptr [esi+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 _EDI = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 __asm { fnstsw ax }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 fld dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 fcomp dword ptr [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 *(int *)&a4->flags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 fld dword ptr [ecx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 fstp [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 fld dword ptr [ecx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 fstp [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9420 fld dword ptr [ecx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9421 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 fstp [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 fld dword ptr [edx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 fstp [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 fld dword ptr [edx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 fstp [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 fld dword ptr [edx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 fstp [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 fld dword ptr [ecx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 fld dword ptr [ecx+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 fld dword ptr [ecx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 fld dword ptr [edx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 fld dword ptr [edx+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 fld dword ptr [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 fld st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 fmul st, st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 fild pIndoorCamera->pos.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 fmul st, st(6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 fld st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 fild pIndoorCamera->pos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465 fmul st, st(7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467 fild pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 fcomp ds:flt_4D84E8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 if ( __SETP__(HIBYTE(_AX) & 0x41, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 _EDI->v_18.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9500 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9501 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9502 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 _EDI->v_18.y = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 _EDI->v_18.z = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 stru148::_486089_normalize_v_18(_EDI);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 fild dword ptr [edi+18h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 fmul dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525 fchs
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526 fild dword ptr [edi+1Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527 fmul dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 fild dword ptr [edi+20h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 fmul dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 _EDI->field_24 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549 //----- (004823F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550 bool __fastcall GetTerrainHeightsAroundParty(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 unsigned int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 int v6; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557 int v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 int v9; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9560 int v11; // [sp+14h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9561 int v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 v12 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 v2 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9566 v3 = WorldPosToGridCellZ(v11) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9567 dword_76D568_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 dword_76D56C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 dword_76D570_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 dword_76D574_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 dword_76D558_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 dword_76D55C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 dword_76D560_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 dword_76D564_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 dword_76D548_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 dword_76D54C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 dword_76D550_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 v4 = pOutdoor->DoGetHeightOnTerrain(v2, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 dword_76D554_terrain_cell_world_pos_around_party_y = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 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
9581 && 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
9582 && dword_76D550_terrain_cell_world_pos_around_party_y == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9583 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9584 v6 = abs(v12 - dword_76D568_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585 if ( abs(dword_76D558_terrain_cell_world_pos_around_party_z - v11) >= v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587 v7 = dword_76D554_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 v8 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 v9 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593 v7 = dword_76D54C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594 v8 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595 v9 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599 v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600 if ( v8 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603 v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 if ( v7 >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608 v10 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610 if ( v7 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612 if ( v8 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 if ( v7 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 return v9 - v10 > 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9623
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9624 //----- (0048257A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9625 int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 unsigned int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628 unsigned int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 int result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 int v7; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 int v8; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 int v9; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 int v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 int v11; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 int v12; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 int v13; // [sp+10h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 signed int v14; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 int v15; // [sp+24h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 v11 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641 v12 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9642 v4 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9643 v5 = WorldPosToGridCellZ(v12) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9644 dword_76D538_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 dword_76D53C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 dword_76D540_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 dword_76D544_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9648 dword_76D528_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9649 dword_76D52C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9650 dword_76D530_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9651 dword_76D534_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9652 dword_76D518_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9653 dword_76D51C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9654 dword_76D520_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 dword_76D524_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 *a3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 if ( pOutdoor->ActuallyGetSomeOtherTileInfo(v4, v5) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 *a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 if ( !a4 && *a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 v14 = -60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 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
9663 || 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
9664 || 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
9665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9666 v7 = abs(v11 - dword_76D538_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9667 if ( abs(dword_76D528_terrain_cell_world_pos_around_party_z - v12) >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 v8 = dword_76D524_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 v9 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671 v10 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672 v15 = v11 - dword_76D544_terrain_cell_world_pos_around_party_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673 v13 = v12 - dword_76D534_terrain_cell_world_pos_around_party_z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 v8 = dword_76D51C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 v9 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679 v10 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680 v15 = dword_76D53C_terrain_cell_world_pos_around_party_x - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 v13 = dword_76D52C_terrain_cell_world_pos_around_party_z - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 result = v14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 + v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685 + ((unsigned __int64)(v13 * (signed __int64)((v10 - v8) << 7)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686 + ((unsigned __int64)(v15 * (signed __int64)((v9 - v8) << 7)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690 result = v14 + dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696 //----- (0048276F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697 void stru148::_48276F_sr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 float v2; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702 char *v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 float v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 float v6; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 float v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 float v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707 int i; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708 int v10; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 RenderVertexSoft *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 RenderVertexSoft *v12; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 RenderVertexSoft *v13; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 int v14; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713 RenderVertexSoft *v15; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 double v16; // st6@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 double v17; // st5@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 double v18; // st4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717 int v19; // [sp+4h] [bp-2Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 int v20; // [sp+8h] [bp-28h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 int v21; // [sp+Ch] [bp-24h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 stru148 *v22; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 float v23; // [sp+14h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 float v24; // [sp+18h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 float v25; // [sp+1Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 float v26; // [sp+20h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 float v27; // [sp+24h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 float v28; // [sp+28h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 float v29; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 v1 = this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730 v22 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 if ( (signed int)v1 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 LODWORD(v2) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 v26 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735 v28 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 v3 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 v27 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 if ( (signed int)v1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 v4 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 if ( *((float *)v4 - 1) < (double)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 LODWORD(v5) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746 v25 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747 v26 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 if ( *((float *)v4 - 1) > (double)v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 LODWORD(v6) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 v27 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 if ( *(float *)v4 < (double)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 LODWORD(v7) = *(int *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 v29 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 v28 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 if ( v3 < *(float *)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 v3 = *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764 v23 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 ++LODWORD(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 v4 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 while ( SLODWORD(v2) < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 v8 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 if ( LODWORD(v29) == LODWORD(v25) || LODWORD(v29) == LODWORD(v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 v8 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 v29 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 for ( i = 0; i < (signed int)v1; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 if ( i == LODWORD(v25) || i == LODWORD(v24) || i == LODWORD(v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 v10 = LODWORD(v29)++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 *(&v19 + v10) = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 v11 = &array_508690[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784 v12 = &array_508690[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 v13 = &array_508690[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786 if ( LODWORD(v29) != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 v11 = array_508690;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 v13 = (RenderVertexSoft *)((char *)array_508690 + 16 * (3 * v1 - 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 v12 = &array_508690[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 v28 = array_508690[1].vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 v27 = array_508690[1].vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 v29 = array_508690[1].vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794 v26 = v13->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 v25 = v13->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 v24 = v13->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 if ( v24 * v27 - v25 * v29 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 if ( v26 * v29 - v24 * v28 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 if ( v25 * v28 - v26 * v27 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 v14 = v1 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 LODWORD(v26) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 if ( v14 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 v15 = &array_508690[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9810 v16 = v15->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9811 v17 = v15->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9812 v18 = v15->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 v13 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 if ( v27 * v18 - v17 * v29 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 if ( v16 * v29 - v18 * v28 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 if ( v28 * v17 - v16 * v27 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 --LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 --v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823 while ( SLODWORD(v26) >= 2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 sr_sub_4829B9(v11, v12, v13, v22, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 //----- (004829B9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834 stru148 *__fastcall sr_sub_4829B9(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836 double v5; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837 RenderVertexSoft *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838 double v7; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 stru148 *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 double v9; // st6@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 double v10; // st5@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 float v11; // ST0C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 float v12; // ST04_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 double v13; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 float v14; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 float v15; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847 float v16; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 float v17; // [sp+1Ch] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 v5 = a2->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 v16 = a3->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 v15 = a2->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 v14 = v6->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 v7 = v16 * v5 - v14 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857 v7 = 0.0000001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 v9 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 v10 = 1.0 / a1->vWorldViewPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 v11 = 1.0 / a2->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 v12 = 1.0 / v6->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863 v13 = (v11 * v16 - v12 * v15) * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864 v17 = (v11 * v14 - v12 * v5) * -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 a4->field_C = a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 a4->field_10 = a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 a4->field_0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 a4->field_8 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 a4->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873 //----- (00482A90) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874 signed int __cdecl const_1_0()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880 //----- (00482A94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881 int sr_sub_482A94(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 int v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 signed int v13; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 int v14; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897 signed __int64 v15; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 stru149 *v16; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 signed int v17; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900 Texture *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 unsigned __int16 *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 stru149 *v20; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 signed int v21; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 int v22; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906 Texture *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 signed int v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 signed int v27; // [sp-4h] [bp-A4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 int v28; // [sp+Ch] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 int v29; // [sp+10h] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 stru316 a2; // [sp+14h] [bp-8Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 stru315 a1; // [sp+3Ch] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 int v32; // [sp+80h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 int v33; // [sp+84h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9915 int v34; // [sp+88h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 int v35; // [sp+8Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 int v36; // [sp+90h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 int v37; // [sp+94h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 int v38; // [sp+98h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 int X; // [sp+9Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 v37 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 v7 = v38 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 v37 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 v33 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 v8 = ((unsigned __int64)(v37 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 v37 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 v9 = v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 v28 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 v35 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 v10 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 v29 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 v32 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 v11 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946 v37 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 v12 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 v13 = -v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 v36 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 X = ((unsigned __int64)(v37 * (signed __int64)v12) >> 16) + v38 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 if ( !X || (v14 = abs(v13 >> 14), v14 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 LODWORD(v15) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 HIDWORD(v15) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 v38 = v15 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956 v16 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 v36 = v16->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 v36 = v33 + ((unsigned __int64)(v36 * (signed __int64)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 v33 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 X = (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 v34 += (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 if ( v38 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 if ( v38 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 if ( v38 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 v27 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9978 v27 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9980 v17 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 if ( v17 < (signed int)v3->ptr_48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 v17 = (signed int)v3->ptr_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 v18 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 if ( v17 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997 v19 = (unsigned __int16 *)v18->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 if ( v17 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 v19 = (unsigned __int16 *)v18->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 v19 = (unsigned __int16 *)v18->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 v19 = (unsigned __int16 *)v18->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 a1.pTextureLOD = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 X = (unsigned __int64)(v36 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 v20 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 X = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 a1.field_30 = v28 + ((unsigned __int64)(v36 * (signed __int64)v38) >> 16) - v20->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 X = (unsigned __int64)(v34 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10017 v21 = X - v3->ptr_38->field_28 - v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 a1.field_30 >>= v17 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 a1.field_2C = v21 >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 v35 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 v37 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v38) >> 16) >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 a1.field_4 = (unsigned __int64)(v37 * (signed __int64)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10023 X = (unsigned __int64)(v37 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 a1.field_0 = -(signed int)((unsigned __int64)(v37 * (signed __int64)v32) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 v22 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026 a1.pColorBuffer = &pRenderer->pTargetSurface[v2->field_8 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027 HIWORD(v23) = HIWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v2->field_8 + 640 * v22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029 LOWORD(v23) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 a1.field_24 = v23 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 v32 = (signed int)v24->uTextureWidth >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 v25 = (signed int)v24->uTextureHeight >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 a1.field_10 = v17 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 a1.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036 a1.field_8 = (v25 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 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
10038 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10040 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 //----- (00482E07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046 signed int __fastcall sr_sub_482E07(Span *ecx0, unsigned __int16 *pRenderTarget)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 stru149 *v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 int v8; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 int v10; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 unsigned __int64 v12; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 signed __int64 v14; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061 int v15; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062 signed __int64 v16; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10063 int v17; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10064 unsigned __int16 *v18; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10065 Texture *v19; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10066 Texture *v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10067 Texture *v21; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 Texture *v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 int v23; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070 Texture *v24; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 signed int v25; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 signed int v26; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073 char v27; // bl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074 stru149 *v28; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075 stru149 *v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076 int v30; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077 int v31; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078 unsigned int v32; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079 int v33; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080 signed __int64 v34; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081 signed int v35; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082 int v36; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083 stru149 *v37; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084 int v38; // edi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 int v39; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086 int v40; // edi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 signed __int64 v41; // qtt@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088 int v42; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089 stru149 *v43; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090 int v44; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091 int v45; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092 Span *v46; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093 stru149 *v47; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 stru149 *v48; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 int v49; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096 int v50; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 unsigned int v51; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 int v52; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 signed __int64 v53; // qtt@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 unsigned int v54; // ecx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101 int v55; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 stru149 *v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 int v57; // edi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 int v58; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 int v59; // edi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106 signed __int64 v60; // qtt@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107 int v61; // edx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108 stru149 *v62; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109 int v63; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110 int v64; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111 int v66; // [sp+Ch] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 int v67; // [sp+10h] [bp-B4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10113 int v68; // [sp+14h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114 int v69; // [sp+18h] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 int v70; // [sp+1Ch] [bp-A8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 int v71; // [sp+20h] [bp-A4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117 signed int v72; // [sp+24h] [bp-A0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 stru316 a2; // [sp+28h] [bp-9Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 int v74; // [sp+50h] [bp-74h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 stru315 a1; // [sp+54h] [bp-70h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 Span *v76; // [sp+98h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122 unsigned __int16 *v77; // [sp+9Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123 int v78; // [sp+A0h] [bp-24h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124 int v79; // [sp+A4h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125 int v80; // [sp+A8h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 int v81; // [sp+ACh] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 int X; // [sp+B0h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128 int v83; // [sp+B4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 int v84; // [sp+B8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 int v85; // [sp+BCh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 int v86; // [sp+C0h] [bp-4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 v85 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134 v3 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 v4 = pViewport->uScreenCenterY - ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136 v77 = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137 v5 = pOutdoorCamera->int_fov_rad_inv * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10138 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 v76 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 v83 = v6->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 v7 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 v8 = v81 + v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 v83 = v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 v67 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 v9 = ((unsigned __int64)(v83 * (signed __int64)v5) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 v71 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 v83 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 v68 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 v69 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 v72 = -v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 v10 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - ecx0->field_8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 v11 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 v66 = v81 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 v83 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 v12 = v10 * (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 v81 = v12 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 v13 = v66 + (v12 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162 v84 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163 if ( !v13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164 || (X = v72 >> 15, v83 = abs(v13), abs(v72 >> 15) >= v83)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165 || (LODWORD(v14) = v72 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 HIDWORD(v14) = v72 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 v79 = v14 / v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 v80 = v10 - v85 * pOutdoorCamera->int_fov_rad_inv,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169 v81 = (unsigned __int64)(v80 * (signed __int64)v3->v_18.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 (v84 = v66 + v81) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 || (v15 = abs(v66 + v81), abs(X) >= v15) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 LODWORD(v16) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174 HIDWORD(v16) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 v70 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176 v17 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 a1.field_24 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 if ( v79 >= v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 a1.field_24 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180 v18 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 if ( a1.field_24 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 if ( a1.field_24 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187 if ( a1.field_24 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 v84 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193 v18 = (unsigned __int16 *)v22->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197 v21 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199 v18 = (unsigned __int16 *)v21->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 v18 = (unsigned __int16 *)v20->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 v19 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 v18 = (unsigned __int16 *)v19->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10214 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 a1.pTextureLOD = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219 v23 = v3->field_5A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10220 v83 = v3->field_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 v74 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 v78 = v85 >> v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 v25 = v24->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 v81 = v85 - (v85 >> v23 << v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 v26 = (signed int)v24->uTextureHeight >> v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10227 a1.field_10 = v84 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10228 v27 = v84 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10229 a1.field_8 = (v26 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 a1.field_C = (v25 >> v84) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231 if ( v79 >= v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 v46 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10234 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
10235 v47 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10237 v86 = v47->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 v79 = (unsigned __int64)(v84 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 v48 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 v79 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v70) >> 16) - v48->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 v79 = (unsigned __int64)(v86 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10247 v49 = ((unsigned __int64)(v86 * (signed __int64)v70) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10248 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10249 a1.field_2C = (v69 + v49) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10250 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10253 v50 = v46->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10254 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10255 v51 = v50 + pRenderer->uTargetSurfacePitch * v46->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10256 a1.pDepthBuffer = (unsigned int *)(&pRenderer->pActiveZBuffer[640 * v46->field_A - 1] + v85 + v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 a1.pColorBuffer = &v77[v85 - 1] + v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 v77 = (unsigned __int16 *)v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 v84 = v66 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 if ( v66 + (unsigned int)((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 && (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
10268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 LODWORD(v53) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10270 HIDWORD(v53) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 v86 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 v54 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273 v84 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 v84 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 v54 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 HIWORD(v55) = HIWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 LOWORD(v55) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 a1.field_24 = v3->field_50 | v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 v77 = (unsigned __int16 *)v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 v77 = (unsigned __int16 *)(v67 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 v56 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 v57 = ((unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16) - v56->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10288 v77 = (unsigned __int16 *)v56->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10289 v77 = (unsigned __int16 *)(v71 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10290 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 v58 = (((v69 + v86 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 a1.field_4 = (((v68 + v57) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 a1.field_0 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10300 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10322 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10323 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10324 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 v86 = (unsigned __int64)(v83 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 v59 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 if ( abs(X) < v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 LODWORD(v60) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 HIDWORD(v60) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 v86 = v60 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 HIWORD(v61) = (unsigned int)(v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 LOWORD(v61) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 a1.field_24 = v61 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 v62 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 v63 = ((unsigned __int64)(v83 * v60 / v84) >> 16) - v62->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 v83 = v62->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 v64 = (((signed int)(v69 + ((unsigned __int64)(v83 * v60 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 a1.field_4 = (((v68 + v63) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 a1.field_0 = v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10351 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 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
10372 v28 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10374 v86 = v28->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 v85 = (unsigned __int64)(v84 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 v29 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 v85 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v79) >> 16) - v29->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 v85 = (unsigned __int64)(v86 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 v30 = ((unsigned __int64)(v86 * (signed __int64)v79) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 a1.field_2C = (v69 + v30) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 v31 = v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 v32 = pRenderer->uTargetSurfacePitch * v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 v86 = v76->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 a1.pColorBuffer = &v77[v86 + v32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v86 + 640 * v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 v80 = v10 - (pOutdoorCamera->int_fov_rad_inv << v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 v86 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 v78 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 v85 = (unsigned __int64)(v78 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404 v84 = v66 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 if ( v66 + (unsigned int)((unsigned __int64)(v78 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 && (v33 = abs((signed __int64)v66 + ((__int64)(v78 * (signed __int64)v80) >> 16)), abs((signed __int64)X) < v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 LODWORD(v34) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 HIDWORD(v34) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 v85 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 v35 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412 v84 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416 v84 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 v35 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 HIWORD(v36) = HIWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 LOWORD(v36) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 a1.field_24 = v3->field_50 | v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422 v78 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 v78 = v67 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425 v37 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426 v38 = ((unsigned __int64)(v78 * (signed __int64)v35) >> 16) - v37->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427 v78 = v37->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 v78 = v71 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430 v39 = (((v69 + v85 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431 a1.field_4 = (((v68 + v38) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 a1.field_0 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 v80 -= pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457 --v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 while ( v86 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 v76 = (Span *)((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 v40 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469 if ( abs(X) < v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 LODWORD(v41) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472 HIDWORD(v41) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 X = v41 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 HIWORD(v42) = (unsigned int)(v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475 LOWORD(v42) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 a1.field_24 = v42 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10480 v43 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481 v44 = ((unsigned __int64)(v83 * v41 / v84) >> 16) - v43->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 v83 = v43->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 v45 = (((signed int)(v69 + ((unsigned __int64)(v83 * v41 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 a1.field_4 = (((v68 + v44) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 a1.field_0 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 //----- (004839BD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521 signed int __fastcall sr_sub_4839BD(Span *ecx0, unsigned __int16 *pTargetSurface)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10525 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 unsigned int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 stru149 *v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 int v12; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535 int v14; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537 int v16; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 signed int v17; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 int v18; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 signed __int64 v19; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 int v20; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 unsigned __int16 *v21; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 Texture *v22; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544 Texture *v23; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 Texture *v24; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 Texture *v25; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 int v27; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 signed int v28; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 Texture *v29; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 int v30; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 signed int v31; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10553 signed int v32; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 int v34; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 int v35; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 int v36; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 int v37; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 signed __int64 v38; // qtt@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 int v39; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 int v40; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 stru149 *v41; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 int v42; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 int v43; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 int v44; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 char v45; // zf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 int v46; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 int v47; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 int v48; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 int v49; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 signed __int64 v50; // qtt@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 int v51; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573 int v52; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574 int v53; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 stru149 *v54; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 int v55; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 signed int v56; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 int v57; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 unsigned __int64 v58; // qax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 int v60; // [sp+Ch] [bp-BCh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581 Span *v61; // [sp+10h] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 int v62; // [sp+14h] [bp-B4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 int v63; // [sp+18h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 stru315 a1; // [sp+1Ch] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 stru316 a2; // [sp+60h] [bp-68h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 int v66; // [sp+88h] [bp-40h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587 int v67; // [sp+8Ch] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 int v68; // [sp+90h] [bp-38h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 int v69; // [sp+94h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 int v70; // [sp+98h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 int v71; // [sp+9Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 int v72; // [sp+A0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 int v73; // [sp+A4h] [bp-24h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 int v74; // [sp+A8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 int v75; // [sp+ACh] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 int v76; // [sp+B0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 int v77; // [sp+B4h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 int X; // [sp+B8h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599 int v79; // [sp+BCh] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600 int v80; // [sp+C0h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601 unsigned int v81; // [sp+C4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603 v3 = ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604 v4 = ecx0->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 v5 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 v6 = v4 + pRenderer->uTargetSurfacePitch * ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607 v61 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 v7 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609 a1.pColorBuffer = &pTargetSurface[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10610 v74 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v4 + 640 * v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10612 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613 v9 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614 v10 = v5->ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10615 v76 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616 v72 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617 v81 = (unsigned __int64)(v10 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618 v11 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619 v12 = v81 + v11->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620 v72 = v11->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621 v67 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622 v13 = ((unsigned __int64)(v72 * (signed __int64)v9) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 v81 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 v70 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 v72 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626 v81 = (unsigned __int64)(v72 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627 v14 = v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10628 v15 = v81 + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10629 v71 = v5->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10630 v63 = v5->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10631 v16 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 v17 = -v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 v60 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 v81 = (unsigned __int64)(v76 * (signed __int64)v16) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636 X = v81 + v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637 if ( !(v81 + v15) || (v62 = v17 >> 14, v18 = abs(v17 >> 14), v18 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 LODWORD(v19) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 HIDWORD(v19) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641 v69 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642 v20 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 v21 = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 a1.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 if ( v20 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648 if ( v20 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 if ( v20 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 v25 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655 v75 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656 v21 = (unsigned __int16 *)v25->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10662 v21 = (unsigned __int16 *)v24->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10668 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 v21 = (unsigned __int16 *)v23->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 v21 = (unsigned __int16 *)v22->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 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
10683 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 v66 = v74 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10685 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 v72 = v74 - 16 * (v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 v76 = v26->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 v74 = v67 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 v76 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 v76 = v70 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 v81 = (unsigned __int64)(v74 * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 v27 = ((unsigned __int64)(v74 * (signed __int64)v20) >> 16) - v5->ptr_38->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 v81 = (unsigned __int64)(v76 * (signed __int64)v69) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 v28 = v63 + ((unsigned __int64)(v76 * (signed __int64)v69) >> 16) - v5->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 v76 = v75 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 v73 = v8 - 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 v30 = (v71 + v27) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 v31 = v28 >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 v32 = (signed int)v29->uTextureWidth >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 v74 = (signed __int16)v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 v68 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 v80 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 v33 = (signed int)v29->uTextureHeight >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 v34 = v75 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 a1.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 v81 = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 a1.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711 a1.field_C = v80 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 if ( v66 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 v74 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 v80 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 v35 = (unsigned __int64)(v80 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 v36 = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 X = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 if ( v35 + v60 && (v80 = abs(v62), v37 = abs(v36), v80 <= v37) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 LODWORD(v38) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 HIDWORD(v38) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 v80 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 v39 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728 X = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 X = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 v39 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 HIWORD(v40) = HIWORD(v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 if ( v39 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 HIWORD(v40) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 LOWORD(v40) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10739 a1.field_24 = v5->field_50 | v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 v41 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 v42 = ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v41->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10745 v79 = v41->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746 v79 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 v43 = (v71 + v42) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 v79 = (signed int)(v63 + ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 a1.field_4 = (v43 - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751 a1.field_0 = (v79 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v68 >> v66));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 v44 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 a1.field_2C = v68 + 4 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759 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
10760 v73 -= 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761 v45 = v74-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10762 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763 v30 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764 v68 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766 while ( !v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767 v31 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769 if ( !v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v31 >> (12 - v75)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773 v46 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774 a1.field_2C = v68 + 4 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775 v79 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776 v80 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777 v47 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778 v48 = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779 X = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780 if ( v47 + v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10782 v79 = abs(v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783 v49 = abs(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784 if ( v79 <= v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786 LODWORD(v50) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787 HIDWORD(v50) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788 v77 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789 v51 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790 HIWORD(v52) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791 if ( v51 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793 LOWORD(v52) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794 a1.field_24 = v52 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798 HIWORD(v53) = HIWORD(v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 LOWORD(v53) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800 a1.field_24 = v53 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803 v77 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 v67 = (unsigned __int64)(v79 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 v54 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807 v55 = v67 - v54->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 v79 = v54->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809 v56 = v71 + v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810 v71 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811 v57 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812 v79 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10813 v58 = v57 * (signed __int64)v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814 v70 = v58 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 LODWORD(v58) = (signed int)(v63 + (v58 >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 a1.field_4 = ((v56 >> v76) - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 a1.field_0 = ((signed int)v58 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818 a1.field_28 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10831 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836 //----- (0048408A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837 signed int sr_sub_48408A_prolly_odm_water_no_waves(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10842 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10843 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10844 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10845 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10846 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10847 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10848 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10849 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852 int v14; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 signed int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 int v16; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 stru149 *v18; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 int v19; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 Texture *v20; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861 Texture *v23; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 stru149 *v25; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 signed int v26; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865 int v27; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 int v28; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867 int v29; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 int v30; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 Texture *v31; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 int v32; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 int v33; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 int v35; // [sp+Ch] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 int v36; // [sp+10h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874 stru316 a2; // [sp+14h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 stru315 a1; // [sp+3Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 int v39; // [sp+80h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 int v40; // [sp+84h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 int v41; // [sp+88h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 int v42; // [sp+8Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 int v43; // [sp+90h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 int v44; // [sp+94h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 v42 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 v7 = v44 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 v42 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 v39 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 v8 = ((unsigned __int64)(v42 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 v42 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 v9 = v44 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 v36 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 v42 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 v14 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 v15 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 v40 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 v16 = ((unsigned __int64)(v42 * (signed __int64)v14) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 v44 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 if ( !v16 || (v43 = abs(v15 >> 14), v43 > abs(v16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 LODWORD(v17) = v40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 HIDWORD(v17) = v40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 v43 = v17 / v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 v18 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 v40 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 v40 = v39 + ((unsigned __int64)(v40 * (signed __int64)v42) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923 v39 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 v44 = (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 v19 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 v41 += (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 if ( v43 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 v21 = (unsigned __int16 *)v20->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 if ( v43 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 v21 = (unsigned __int16 *)v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10945 if ( v43 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 v44 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 v21 = (unsigned __int16 *)v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10954 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10955 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10957 v23 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10958 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 a1.pTextureLOD = (unsigned __int16 *)v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10961 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10962 v43 = (unsigned __int64)(v40 * (signed __int64)v43) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10963 v25 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10964 v43 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 a1.field_30 = ((unsigned __int64)(v40 * (signed __int64)v19) >> 16) - v25->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10966 v43 = (unsigned __int64)(v41 * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10967 v26 = ((unsigned __int64)(v41 * (signed __int64)v19) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10968 v27 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10969 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10970 v41 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 a1.field_2C = v26 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10972 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10974 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10975 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10976 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10979 v41 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10980 v42 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v19) >> 16) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10981 a1.field_4 = (unsigned __int64)(v42 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10982 v43 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 a1.field_0 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10984 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
10985 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10986 v28 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10987 v29 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10988 a1.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 v30 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 a1.pColorBuffer = &pRenderer->pTargetSurface[v30 + pRenderer->uTargetSurfacePitch * v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v30 + 640 * v28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 v31 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993 v32 = ((signed int)v31->uTextureWidth >> v44) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994 v33 = ((signed int)v31->uTextureHeight >> v44 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995 a1.field_10 = v44 - v31->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 a1.field_C = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 a1.field_8 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11017 //----- (00484442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11018 signed int sr_sub_484442(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11020 int v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 signed int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 int v15; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035 signed __int64 v16; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 int v17; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037 int v18; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039 signed int v20; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 stru149 *v22; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 signed int v23; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 int v24; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044 int v25; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045 unsigned int *v26; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 Texture *v27; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047 signed int v28; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 signed int v29; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 signed int v31; // [sp+Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 int v32; // [sp+10h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 int v33; // [sp+14h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 stru316 v34; // [sp+18h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053 stru315 v35; // [sp+40h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054 int v36; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 int v37; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 int v38; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 int v39; // [sp+90h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 int v40; // [sp+94h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 int v41; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 v39 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 v7 = v40 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 v39 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 v36 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 v8 = ((unsigned __int64)(v39 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 v38 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 v39 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 v9 = v40 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 v32 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 v33 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 v35.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085 v41 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 v14 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 v31 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 v15 = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * v12 * (signed __int64)v3->v_18.y) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 v37 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 if ( !v15 || (v39 = abs(v14 >> 14), v39 > abs(v15)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 LODWORD(v16) = v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 HIDWORD(v16) = v31 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 v40 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 v17 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 v18 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097 HIWORD(v19) = (unsigned int)(v16 / v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 v35.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 v37 = v36 + ((unsigned __int64)(v3->ptr_38->field_10 * (signed __int64)v41) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 v36 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 v41 = (unsigned __int64)(v36 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103 v38 += (unsigned __int64)(v36 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 v35.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 if ( v17 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11108 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11109 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11110 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 v35.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 if ( v17 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 if ( v17 < mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 v20 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 v41 = (unsigned __int64)(v37 * (signed __int64)v17) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11133 v22 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 v41 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 v35.field_30 = ((unsigned __int64)(v37 * (signed __int64)v17) >> 16) - v22->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 v23 = ((unsigned __int64)(v38 * (signed __int64)v17) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 v24 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 v35.field_30 >>= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11139 v38 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 v35.field_2C = v23 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 v35.field_14 = dword_80AA20 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 v35.field_18 = dword_80AA1C >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 v35.field_1C = dword_80AA18 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 v35.field_20 = dword_80AA14 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 v38 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 v39 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v40) >> 16) >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 v35.field_4 = (unsigned __int64)(v39 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 v41 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 v35.field_0 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 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
11154 v25 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 v26 = (unsigned int *)&pRenderer->pActiveZBuffer[v25 + 640 * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11156 v35.pColorBuffer = &pRenderer->pTargetSurface[v25 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 v35.pDepthBuffer = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 v27 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159 v28 = (signed int)v27->uTextureWidth >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160 v29 = (signed int)v27->uTextureHeight >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 v35.field_10 = v20 - v27->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 v35.field_C = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 v35.field_8 = (v29 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 sr_sub_485D3E(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 sr_sub_485C89(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 sr_sub_4D72EC(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 sr_sub_4D73DF(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182 //----- (004847EB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183 int sr_sub_4847EB(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 int v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 int v7; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 stru149 *v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 stru149 *v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 int v10; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 int v11; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 signed int v12; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 int v13; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 signed __int64 v14; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200 signed int v16; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 unsigned __int16 *v17; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 stru149 *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 stru149 *v19; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 signed int v20; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 int v21; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 Texture *v22; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 signed int v23; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 int v24; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 int v25; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 int v26; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 int v27; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 int v28; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 int v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 signed __int64 v30; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 int v31; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 int v32; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217 stru149 *v33; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218 signed int v34; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219 int v35; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11220 signed int v36; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11221 signed __int64 v37; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11222 signed int v38; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11223 int v39; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224 int v40; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225 unsigned __int64 v41; // qax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 int v42; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 int v43; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 signed __int64 v44; // qtt@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229 int v45; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230 int v46; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231 stru149 *v47; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232 signed int v48; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233 int v49; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234 int v50; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235 unsigned __int64 v51; // qax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236 int v52; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237 int v53; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 signed __int64 v54; // qtt@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 int v55; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 int v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241 stru149 *v57; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242 signed int v58; // edi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 int v59; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244 Span *v61; // [sp+Ch] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245 int v62; // [sp+10h] [bp-ACh]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 int v63; // [sp+14h] [bp-A8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 int v64; // [sp+18h] [bp-A4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248 int v65; // [sp+1Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249 signed int v66; // [sp+20h] [bp-9Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 signed int v67; // [sp+24h] [bp-98h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 int v68; // [sp+28h] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 char v69; // [sp+2Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253 stru315 sr; // [sp+30h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254 stru316 sr2; // [sp+74h] [bp-48h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 int v72; // [sp+9Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 int v73; // [sp+A0h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 int v74; // [sp+A4h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 int v75; // [sp+A8h] [bp-14h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 int v76; // [sp+ACh] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 int v77; // [sp+B0h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 int v78; // [sp+B4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 int v79; // [sp+B8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 v2 = _this->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265 v3 = _this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 v4 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268 v61 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 sr.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 v5 = _this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 sr.pColorBuffer = &pRenderer->pTargetSurface[v3 + pRenderer->uTargetSurfacePitch * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 v68 = texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274 v69 = texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 if ( v5 >= texmapping_terrain_subdivsize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 v73 = texmapping_terrain_subdivsize - (v3 & (texmapping_terrain_subdivsize - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277 v6 = v5 - v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11278 v67 = v6 >> texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 v62 = v6 - (v6 >> texmapping_terrain_subdivpow2 << texmapping_terrain_subdivpow2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 v8 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 v79 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11283 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 v76 = v8->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286 v9 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11287 v10 = v78 + v9->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 v76 = v9->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 v65 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 v11 = ((unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 + v4->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11292 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11293 v64 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11294 v76 = v4->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11295 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 v12 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 v63 = v78 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 v66 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 v78 = (unsigned __int64)(v79 * (signed __int64)v4->v_18.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 v74 = v78 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 if ( !(v78 + v63) || (v76 = v12 >> 14, v13 = abs(v12 >> 14), v13 > abs(v74)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 LODWORD(v14) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 HIDWORD(v14) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 v72 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 sr.pTextureLOD = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 v15 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11308 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11309 if ( v15 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11311 if ( v15 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 if ( v15 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 v16 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11318 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail3;
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 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 sr.pTextureLOD = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 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
11339 v18 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11341 v79 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 v77 = v65 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 v79 = v4->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 v79 = v64 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 v78 = (unsigned __int64)(v77 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 v19 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 v78 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 sr.field_30 = ((unsigned __int64)(v77 * (signed __int64)v72) >> 16) - v19->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 v78 = (unsigned __int64)(v79 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 v20 = ((unsigned __int64)(v79 * (signed __int64)v72) >> 16) - v4->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 v21 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 sr.field_30 >>= v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 v78 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 sr.field_2C = v20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 sr.field_14 = dword_80AA20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 sr.field_18 = dword_80AA1C >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 sr.field_1C = dword_80AA18 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 sr.field_20 = dword_80AA14 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 v22 = v4->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 v79 = (signed int)v22->uTextureWidth >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 v23 = (signed int)v22->uTextureHeight >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 v24 = v16 - v22->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 sr.field_8 = (v23 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 sr.field_10 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 sr.field_C = v79 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 if ( v73 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 v25 = v7 - v73 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 v77 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 v79 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 v27 = (unsigned __int64)(v77 * (signed __int64)v25) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 v28 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11378 v74 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11379 if ( !(v27 + v63) || (v77 = abs(v76), v29 = abs(v28), v77 > v29) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 LODWORD(v30) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 HIDWORD(v30) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 v77 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 v31 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 HIWORD(v32) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 if ( v72 <= v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 HIWORD(v32) = HIWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 LOWORD(v32) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 sr.field_24 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 v74 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 v74 = v65 + ((unsigned __int64)(v74 * (signed __int64)v26) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 v77 = (unsigned __int64)(v74 * (signed __int64)v31) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 v33 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 v34 = ((unsigned __int64)(v74 * (signed __int64)v31) >> 16) - v33->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 v74 = v33->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398 v74 = v64 + ((unsigned __int64)(v74 * (signed __int64)v26) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 v77 = (unsigned __int64)(v74 * (signed __int64)v31) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 v35 = (v77 - v4->ptr_38->field_28) >> v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 v74 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 v36 = (v34 >> v78) - sr.field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 LODWORD(v37) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 HIDWORD(v37) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 v38 = v35 - sr.field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406 sr.field_4 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 v75 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 LODWORD(v37) = v38 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 HIDWORD(v37) = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 v77 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 sr.field_0 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412 sr.field_28 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11420 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11423 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427 v39 = v79 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11429 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 v79 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11432 v39 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 while ( v67 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437 v40 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11438 --v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11439 v75 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440 v41 = v40 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 v79 = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 LODWORD(v41) = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 v42 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11444 v74 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11445 if ( !((int)v41 + v63) || (v75 = abs(v76), v43 = abs(v42), v75 > v43) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 LODWORD(v44) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 HIDWORD(v44) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 v73 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 v45 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 HIWORD(v46) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 if ( v72 <= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 HIWORD(v46) = HIWORD(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 LOWORD(v46) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 sr.field_24 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 v79 = (unsigned __int64)(v75 * (signed __int64)v45) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 v47 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 v48 = ((unsigned __int64)(v75 * (signed __int64)v45) >> 16) - v47->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11463 v75 = v47->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 v75 = v64 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 v79 = (unsigned __int64)(v75 * (signed __int64)v45) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11466 v49 = (((v79 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11467 sr.field_4 = ((v48 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 sr.field_0 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11469 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11474 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11476 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11483 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
11484 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 v39 -= pOutdoorCamera->int_fov_rad_inv << v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 if ( !v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 v50 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 v75 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 v51 = v50 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 v79 = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 LODWORD(v51) = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11494 v52 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11495 v74 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11496 if ( (int)v51 + v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 v75 = abs(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11499 v53 = abs(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11500 if ( v75 <= v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 LODWORD(v54) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11503 HIDWORD(v54) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 v76 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 v55 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11506 HIWORD(v56) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11507 if ( v72 <= v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 HIWORD(v56) = HIWORD(v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 LOWORD(v56) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 sr.field_24 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11512 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11514 v76 = (unsigned __int64)(v75 * (signed __int64)v55) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 v57 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11516 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11517 v58 = ((unsigned __int64)(v75 * (signed __int64)v55) >> 16) - v57->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 v75 = v57->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 v75 = v64 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11520 v76 = (unsigned __int64)(v75 * (signed __int64)v55) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 v59 = (((v76 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11522 sr.field_4 = ((v58 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11523 sr.field_0 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 sr.field_28 = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11536 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11537 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11539 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 // 6BE050: using guessed type int texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 // 6BE054: using guessed type int texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11547 // 6BE0F0: using guessed type int mipmapping_terrain_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 // 6BE0F4: using guessed type int mipmapping_terrain_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 // 6BE0F8: using guessed type int mipmapping_terrain_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 // 80AA10: using guessed type char byte_80AA10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11558 //----- (00485407) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11559 signed int __fastcall sr_sub_485407_prolly_odm_water_wavy(Span *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11561 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11562 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11563 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11564 unsigned int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11565 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11566 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11567 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11568 int v8; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11569 stru149 *v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 stru149 *v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11571 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11572 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11574 int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 signed int v15; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 int v16; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 int v18; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580 unsigned __int8 *pLOD; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581 Texture *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 Texture *v23; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 stru149 *v25; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587 signed int v27; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 stru149 *v28; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 Texture *v29; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11590 signed int v30; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 signed int v31; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 signed int v32; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 int v34; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 int v35; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11596 unsigned __int64 v36; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 int v37; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 unsigned __int64 v38; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 char v39; // cl@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 stru316 a2; // [sp+Ch] [bp-90h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11601 stru315 a1a; // [sp+34h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 Span *v43; // [sp+78h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 int v44; // [sp+7Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11604 int v45; // [sp+80h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 int v46; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606 Span *v47; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 int v48; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 int v49; // [sp+90h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 int i; // [sp+94h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 int X; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11612 v2 = a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613 v3 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 v4 = v3 + pRenderer->uTargetSurfacePitch * a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615 v5 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 v43 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11617 v6 = a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11618 a1a.pColorBuffer = &pRenderer->pTargetSurface[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 v46 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11621 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 a1a.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11623 v9 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11624 v47 = (Span *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11625 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 v48 = v9->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11627 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 v10 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 v11 = X + v10->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11630 v48 = v10->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11632 v12 = ((unsigned __int64)(v48 * (signed __int64)v8) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 v45 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 v48 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 v13 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11638 v14 = X + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 v15 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 v48 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 X = ((unsigned __int64)(v7 * (signed __int64)v13) >> 16) + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 if ( !X || (v16 = abs(v15 >> 14), v16 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644 LODWORD(v17) = v48 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 HIDWORD(v17) = v48 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 i = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647 v18 = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648 HIWORD(v19) = (unsigned int)(v17 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11649 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11650 a1a.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11651 pLOD = v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 a1a.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 if ( v18 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11656 if ( v18 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11658 if ( v18 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11660 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11661 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11662 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11663 v49 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 pLOD = v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11670 pLOD = v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11673 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11675 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11676 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 pLOD = v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11680 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 v21 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 pLOD = v21->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 a1a.pTextureLOD = (unsigned __int16 *)pLOD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 if ( !pLOD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 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
11691 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 v43 = (Span *)(v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11693 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 v25 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11695 v48 = v46 - 16 * (v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 v46 = v25->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 v46 = v44 + ((unsigned __int64)(v46 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699 v44 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 v45 += (unsigned __int64)(v44 * (signed __int64)v7) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701 X = (unsigned __int64)(v46 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 X = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 v27 = ((unsigned __int64)(v46 * (signed __int64)v18) >> 16) - v26->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11705 X = (unsigned __int64)(v45 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11706 v28 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 v44 = bUseLoResSprites + v49 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11709 v30 = v27 >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11710 v31 = (signed int)(((unsigned __int64)(v45 * (signed __int64)v18) >> 16) - v28->field_28) >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11711 v32 = (signed int)v29->uTextureWidth >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11712 v33 = (signed int)v29->uTextureHeight >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713 v34 = v49 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714 a1a.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11715 X = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11716 v45 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717 a1a.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718 a1a.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11719 i = (unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)i) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720 v47 = (Span *)(i >> v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11721 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722 v36 = (signed int)v47 * (signed __int64)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723 i = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724 a1a.field_4 = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725 v37 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 v38 = (signed int)v47 * (signed __int64)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11727 i = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 a1a.field_0 = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11729 if ( (signed int)v43 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 v47 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 v39 = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 for ( i = 12 - v49; ; v39 = i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> v39));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11738 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11739 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11740 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742 v30 += 16 * a1a.field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 v31 += 16 * a1a.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11744 v47 = (Span *)((char *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11745 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 i = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> (12 - v49)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 a1a.field_28 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11757 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11758 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11760 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11762
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11763
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11764 //----- (0048585C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765 signed int __fastcall sr_sub_48585C_mb_DrawSpan(Span *a1, unsigned __int16 *pRenderTarget, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11767 Span *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 stru148 *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 signed __int64 v6; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11771 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 signed int v8; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 void *v9; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11774 int v10; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11775 unsigned __int16 *pPixels; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11776 signed int v13; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11777 int X; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11779 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11780 pPixels = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 v4 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 v13 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 X = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11784 * (pViewport->uScreenCenterX - (signed int)a1->field_8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 * (signed __int64)v4->v_18.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11786 + ((unsigned __int64)(v4->v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788 * (pViewport->uScreenCenterY - (signed int)a1->field_A))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11789 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 if ( X && (v5 = abs(-v4->field_24 >> 14), v5 <= abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 LODWORD(v6) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 HIDWORD(v6) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794 v7 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795 v8 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799 v7 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 v8 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 v9 = sr_sub_47C178(v8, v4, pOutdoorCamera->terrain_gamma, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 fill_pixels_fast(*((short *)v9 + v4->pTexture->uDecompressedSize), pPixels, v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 HIWORD(v10) = HIWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805 LOWORD(v10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 j_memset32(v10, &pRenderer->pActiveZBuffer[v3->field_8 + 640 * v3->field_A], v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 //----- (00485975) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811 stru315 *__fastcall sr_sub_485975(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11812 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11813 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11814 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11817 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11819 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11822 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11823 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11824 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11827 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11828 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11829 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11833 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11837 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11838 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11840 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11844 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11846 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11847 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11848 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11849 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11850 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11852 v11 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11853 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11855 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11857 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11859 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11860 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11861 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11862 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11863 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11864 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11867 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11869 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11871 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11872
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11873 //----- (00485A24) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11874 stru315 *__fastcall sr_sub_485A24(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11878 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11879 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11880 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11881 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11883 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11884 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11885 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11886 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11887 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11888 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11889 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11890 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11891 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11893 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11894 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11896 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11897 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11898 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11899 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11900 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11901 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11902 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11903 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11904 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11905 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11906 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11907 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11908 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11909 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11910 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11911 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11912 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11914 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11915 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11916 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11919 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11925 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11926 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11927 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11929 v14 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11932 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11934 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11936 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11937 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11938 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11939 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11940 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11941 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11942 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11943 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11944 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11946 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11947 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11950 //----- (00485AFF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11951 stru315 *__fastcall sr_sub_485AFF(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11953 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11954 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11955 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11956 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11957 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11958 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11959 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11960 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11961 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11963 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11964 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11965 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11966
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11967 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11968 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11970 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11971 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11973 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11974 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11975 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11977 v7 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11978 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11979 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11980 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11981 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11982 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11984 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11986 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11989 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11992 v11 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 //----- (00485BAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014 stru315 *__fastcall sr_sub_485BAE(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12016 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12028 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12029 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12030 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12031 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12049 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12050 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12051 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12054 v10 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12061 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12063 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12069 v14 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12072 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090 //----- (00485C89) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091 stru315 *__fastcall sr_sub_485C89(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 int v7; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 int v8; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 int v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101 unsigned __int16 *v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 unsigned int *v11; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103 int v12; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12104 int v13; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12109 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113 v13 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12114 if ( *((char *)result->pTextureLOD + v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12115 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12116 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12118 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12119 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12120 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12121 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12122 if ( a2->field_8 - v8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12124 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12126 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12128 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12129 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12130 v9 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12132 v10 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12133 v6 = v13 + (v9 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12135 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12137 v10 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12139 *result->pColorBuffer = v10[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12141 v11 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12142 v12 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12143 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12144 *v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12145 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12146 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12147 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12148 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12149 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12150 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12151 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12153
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12154 //----- (00485D3E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12155 stru315 *__fastcall sr_sub_485D3E(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12157 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12158 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12159 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12160 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12161 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12162 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12163 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12164 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12165 int v10; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12166 int v11; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12167 int v12; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12168 unsigned __int16 *v13; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12169 unsigned int *v14; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12170 int v15; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12171 int v16; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12173 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12174 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12176 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12177 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12178 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12179 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12180 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12181 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12182 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12183 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12184 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12185 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12186 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12187 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12188 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12189 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12190 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12191 v16 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12192 if ( *((char *)result->pTextureLOD + v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12194 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12196 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12197 v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12199 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12200 if ( a2->field_8 - v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12202 v12 = 0;
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 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12207 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12208 v12 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12210 v13 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12211 v9 = v16 + (v12 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12213 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12215 v13 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12217 *result->pColorBuffer = v13[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12219 v14 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12220 v15 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12222 *v14 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12225 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12226 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12232 //----- (00485E1F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233 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
12234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12235 stru316 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12236 signed int *v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237 signed int *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12238 char v10; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12239 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12240 Span *v12; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 double v13; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 double v14; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243 int v15; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12244 signed int v16; // ST14_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12245 char v17; // dl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12246 signed int v18; // ST10_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12247 void *v19; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12248 signed int v20; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 char v21; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 int v22; // ST10_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 signed int v23; // ST14_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 char v24; // dl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 Span *v26; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12254 char v27; // [sp+16h] [bp-2h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12255 char v28; // [sp+17h] [bp-1h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12256 float v29; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12257 float v30; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12258
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 v7 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260 v26 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12261 v8 = &a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 v9 = &a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 v10 = a1->field_0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 v27 = a1->field_4 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 v28 = !v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12266 sr_sub_47BEB1(a3, a4, a5, 0, &a1->field_8, &a1->field_C, (int)&v27, (int)&v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 v7->field_24_palette = (unsigned __int16 *)sr_sub_47C28C_get_palette(a4, v28, *v9, *v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 v11 = a4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 v7->field_20 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12272 if ( a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 v12 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 v29 = v26->field_10 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12276 v13 = v29 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 v7->field_10 = LODWORD(v13) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12278 v30 = v12->field_14 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279 v14 = v30 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 v15 = v7->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 v7->field_14 = LODWORD(v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12282 v7->field_18 = -((v15 - (LODWORD(v14) << 16)) / v12->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 v16 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285 v17 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12286 v18 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 v7->field_1C = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12288 v19 = sr_sub_47C28C_get_palette(a4, v17, v18, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292 v20 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293 v21 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294 v7->field_10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295 v7->field_14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 v22 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 v7->field_18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298 v7->field_1C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299 v19 = sr_sub_47C1CA(a4, v21, v22, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301 v23 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12302 v24 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303 v7->field_24_palette = (unsigned __int16 *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 return sr_sub_47C1CA(a4, v24, *v9, v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 //----- (00485F53) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12308 void __thiscall sub_485F53(Vec2_int_ *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 ++v->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311 if ( v->y > 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12312 v->y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12316
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317 //----- (00485F64) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12318 void OutdoorCamera::_485F64()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12322 signed __int64 v3; // qtt@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 this->uCameraFovInDegrees = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12326 v1 = stru_5C6E00->uPiMask & 0xD5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 if ( v1 >= (signed int)stru_5C6E00->uIntegerHalfPi )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 v2 = -stru_5C6E00->pTanTable[stru_5C6E00->uIntegerPi - v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12330 v2 = stru_5C6E00->pTanTable[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12331 LODWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12332 HIDWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 15 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12333 v4 = (signed int)(v3 / v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12334 this->int_fov_rad = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12335 this->field_4C = 360000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336 this->int_fov_rad_inv = 65536 / v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12337 this->field_50 = 115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12338 unnamed_6BE060[1] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 //----- (0048600E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343 void OutdoorCamera::RotationToInts()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 camera_rotation_y_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 camera_rotation_y_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 camera_rotation_x_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 camera_rotation_x_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352 //----- (0048607B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353 void stru148::_48607B(stru149 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355 this->pTexture = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12356 this->ptr_38 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12358
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12359 //----- (00486089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360 void stru148::_486089_normalize_v_18()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12362 stru148 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 double v3; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365 float v4; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12366 double v5; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12367 float v6; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12368 double v7; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12369 float v8; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370 float v9; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 double v10; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 float v11; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 double v12; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 float v13; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 double v14; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376 float v15; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12378 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379 v2 = (double)this->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 v3 = (double)this->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 v5 = (double)this->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 v7 = sqrt(v5 * v5 + v3 * v3 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12384 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 v1->v_18.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 v1->v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12388 v1->v_18.z = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12390 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 v8 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12393 v9 = v8 * v15 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 v1->v_18.x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12396 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12397 v11 = v8 * v4 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 v1->v_18.y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12400 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 v13 = v8 * v6 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 v1->v_18.z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12406
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12407 //----- (0048616B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408 int stru149::_48616B(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 int v8; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412 int v9; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12416 int v13; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 int v14; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418 int v15; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419 int v16; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 int v17; // ST0C_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12421 int v18; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12422 int v19; // ST0C_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12423 int v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 int v21; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 int v24; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 int v25; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12429 int v26; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12430 int v27; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12431 int v28; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 int v29; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434 v25 = pOutdoorCamera->camera_rotation_x_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435 v7 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436 v27 = pOutdoorCamera->camera_rotation_x_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 v8 = -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 v9 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 v26 = -pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12440 v24 = -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 v10 = pOutdoorCamera->camera_rotation_y_int_cosine * -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 v11 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 v14 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 v15 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 this->field_0 = ((unsigned __int64)(v11 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 + ((unsigned __int64)(-65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 * pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 this->field_4 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 v13 = ((unsigned __int64)((v26 << 16) * (signed __int64)v25) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 - ((unsigned __int64)(v14 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 this->field_4 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 this->field_0 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 v13 = v26 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 this->field_8 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 v17 = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467 this->field_C = ((unsigned __int64)(v17 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12468 + ((unsigned __int64)(a4 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12470 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12471 v16 = ((unsigned __int64)(a4 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v17 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 this->field_C = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476 + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12477 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12478 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 v16 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12481 this->field_14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12482 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12484 v19 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12485 this->field_18 = ((unsigned __int64)(v19 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 + ((unsigned __int64)(a7 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12487 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 v18 = ((unsigned __int64)(a7 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493 this->field_18 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12494 + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12497 v18 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 this->field_20 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 v20 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 v21 = ((unsigned __int64)(v20 * (signed __int64)this->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12506 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 v28 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 v22 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509 this->field_24 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 v29 = (unsigned __int64)(v28 * (signed __int64)v22) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 this->field_28 = v29 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12513 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12515
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12516 //----- (0048653D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517 int stru149::_48653D(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 stru149 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12520 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 int v13; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 int v14; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 int v15; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12528 int v16; // ST14_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529 int v17; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12530 int v18; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 int v19; // ST10_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 int v20; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 int v21; // ST10_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 int v23; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 int v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12537 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12538 int v26; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12539 int v27; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12540 int v28; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12541 int v29; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12542 int v30; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12543 int v31; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 v7 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12546 v8 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12547 v29 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12548 v28 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12549 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12550 v11 = -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12551 v26 = -pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12552 v27 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12553 v12 = -pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 v16 = v8 * -pBLVRenderParams->vPartyPos.x + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 v17 = -65536 * pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 v7->field_0 = ((unsigned __int64)(v16 * (signed __int64)v28) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 + ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 v15 = ((unsigned __int64)(v17 * (signed __int64)v28) >> 16) - ((unsigned __int64)(v16 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 v7->field_0 = v10 + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 v15 = v12 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573 v7->field_8 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 v19 = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 v7->field_C = ((unsigned __int64)(v19 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 + ((unsigned __int64)(a4 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 v18 = ((unsigned __int64)(a4 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 v7->field_C = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 v18 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 v7->field_14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 v21 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 v7->field_18 = ((unsigned __int64)(v21 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 + ((unsigned __int64)(a7 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 v20 = ((unsigned __int64)(a7 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v21 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 v7->field_18 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604 + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 v20 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 v7->field_18 = -v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610 v7->field_1C = -v7->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 v7->field_20 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 v22 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 v7->field_20 = -v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614 v23 = ((unsigned __int64)(v22 * (signed __int64)v7->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 + ((unsigned __int64)(v7->field_10 * (signed __int64)v7->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 + ((unsigned __int64)(v7->field_14 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617 v30 = v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 v24 = v7->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 v7->field_24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620 v31 = (unsigned __int64)(v30 * (signed __int64)v24) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 result = (unsigned __int64)(v7->field_1C * (signed __int64)v7->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 v7->field_28 = v31 + result + ((unsigned __int64)(v7->field_20 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 //----- (0048694B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627 int stru149::_48694B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630 int v2; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631 int v3; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 int v5; // ST0C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12635
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12636 v1 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 v2 = (unsigned __int64)(v1 * (signed __int64)this->field_0) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641 v3 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642 v4 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 this->field_24 = v2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12645 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12646 v5 = (unsigned __int64)(v3 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648 this->field_28 = v5 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653 //----- (00486A28) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654 void OutdoorCamera::AllocSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 if ( !this || !pSpans )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 ReleaseSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 pSpans = (Span *)pAllocator->AllocNamedChunk(pSpans, 0x493E0u, "SPANS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 pEdges = (Edge *)pAllocator->AllocNamedChunk(pEdges, 0x4C2C0u, "EDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661 pSurfs = (Surf *)pAllocator->AllocNamedChunk(pSurfs, 0x11940u, "SURFS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 pNewEdges = (Edge *)pAllocator->AllocNamedChunk(pNewEdges, 0x6180u, "NEWEDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 memset(pSpans, 0, 0x493E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 memset(pEdges, 0, 0x4C2C0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 memset(pSurfs, 0, 0x11940u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 memset(pNewEdges, 0, 0x6180u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 //----- (00486AFC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671 void OutdoorCamera::ReleaseSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 pAllocator->FreeChunk(pSpans);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 pAllocator->FreeChunk(pEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 pAllocator->FreeChunk(pSurfs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 pAllocator->FreeChunk(pNewEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 pSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 pEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 pSurfs = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 pNewEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 //----- (00486B4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684 char __fastcall sr_sub_486B4E_push_outdoor_edges(RenderVertexSoft *a1, int *a2, int *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687 RenderVertexSoft *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688 char v6; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691 int *v9; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692 int v10; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693 int v11; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694 double v12; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 int *v13; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 double v14; // st6@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 double v15; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 int v16; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 double v17; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 double v18; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 int v19; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 double v20; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 double v21; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 Edge *i; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705 double v23; // st7@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 Edge *v24; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 std::string v26; // [sp-18h] [bp-98h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 const char *v27; // [sp-8h] [bp-88h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 int v28; // [sp-4h] [bp-84h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 double v29; // [sp+Ch] [bp-74h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 double v30; // [sp+14h] [bp-6Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712 double v31; // [sp+1Ch] [bp-64h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 double v32; // [sp+24h] [bp-5Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 double v33; // [sp+2Ch] [bp-54h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 unsigned int v34; // [sp+34h] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 unsigned __int64 v35; // [sp+38h] [bp-48h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 int v36; // [sp+40h] [bp-40h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718 int v37; // [sp+44h] [bp-3Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 float v38; // [sp+48h] [bp-38h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 int v39; // [sp+4Ch] [bp-34h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12721 int v40; // [sp+50h] [bp-30h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 int v41; // [sp+54h] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 RenderVertexSoft *v42; // [sp+58h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 int v43; // [sp+5Ch] [bp-24h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 int v44; // [sp+60h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 int v45; // [sp+64h] [bp-1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12727 unsigned int v46; // [sp+68h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 int *v47; // [sp+6Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 int v48; // [sp+70h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 float *v49; // [sp+74h] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 float v50; // [sp+78h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 float v51; // [sp+7Ch] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735 v5 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 v47 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 v6 = (HIBYTE(a4->flags) & 0x40) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 v42 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 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
12742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 LOBYTE(v7) = v4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12744 v8 = v4->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 v4->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12746 BYTE3(a4) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12748 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12750 if ( (signed int)pOutdoorCamera->uNumSurfs < 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 v7 = pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 if ( (signed int)pOutdoorCamera->uNumEdges < 5979 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 v4->uEdgeList1Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 v4->uEdgeList2Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 v45 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 v34 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 v28 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 v27 = (const char *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 v44 = 10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 pGame->pLightmapBuilder->_45CB89(v5, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 v9 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 v49 = &v5->flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 v46 = (char *)v47 - (char *)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771 v10 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 ++pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 if ( v48 >= v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775 v11 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 LODWORD(v50) = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 if ( SLODWORD(v50) > v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 v45 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 if ( v11 < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781 v12 = (double)SLODWORD(v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 v13 = &a3[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 v51 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 v14 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 v50 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 *(float *)&v40 = v14 - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787 v33 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 v43 = LODWORD(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 if ( LODWORD(v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 if ( SLODWORD(v33) >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 v19 = (int)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 ptr_80C978_Edges->field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 LODWORD(v38) = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 v40 = *(unsigned int *)LODWORD(v38) - *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 v20 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 v40 = *v13 - *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800 v21 = v20 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 ptr_80C978_Edges->field_4 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 ptr_80C978_Edges->field_0 = (v51 - (double)*v9) * v21 + (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 ptr_80C978_Edges->field_1C = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 ptr_80C978_Edges->field_20 = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 ptr_80C978_Edges->field_24 = (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 ptr_80C978_Edges->field_28 = (double)(signed int)*(unsigned int *)LODWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 ptr_80C978_Edges->field_2C = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 ptr_80C978_Edges->field_30 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 v4->pEdgeList1[v4->uEdgeList1Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 v32 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 v39 = LODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 v51 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 v15 = (double)SLODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 ptr_80C978_Edges->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12821 v16 = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 v50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12823 v40 = *(int *)((char *)v9 + v46) - *(int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12825 v17 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 v40 = *v9 - *v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 v18 = v17 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828 ptr_80C978_Edges->field_4 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12829 ptr_80C978_Edges->field_0 = (v51 - (double)*v13) * v18 + (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832 ptr_80C978_Edges->field_1C = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 ptr_80C978_Edges->field_20 = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 ptr_80C978_Edges->field_24 = (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 ptr_80C978_Edges->field_28 = (double)*(int *)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 ptr_80C978_Edges->field_2C = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 ptr_80C978_Edges->field_30 = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 v4->pEdgeList2[v4->uEdgeList2Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 v31 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 v37 = LODWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 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
12844 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845 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
12846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847 ptr_80C978_Edges->pNext = i->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12848 i->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 ptr_80C978_Edges->pNext = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 i->pPrev->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 v23 = v50 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 *(float *)&v40 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 v38 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12858 v30 = v38 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 v36 = LODWORD(v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 ptr_80C978_Edges->ptr_18 = ptr_80CA10[LODWORD(v30)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 v29 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 v35 = __PAIR__(v40, LODWORD(v29));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863 v24 = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 ptr_80CA10[LODWORD(v29)] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 v24->pSurf = ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 if ( ptr_80C978_Edges < &pEdges[5999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 ++ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 v49 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 while ( v48 - 1 < v41 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 LOBYTE(v7) = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 if ( pOutdoorCamera->uNumEdges != v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 v4->ptr_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12879 ptr_80C97C_Surfs->field_22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12880 ptr_80C97C_Surfs->pParent = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12881 ptr_80C97C_Surfs->field_4 = v4->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12882 ptr_80C97C_Surfs->field_8 = v4->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12883 ptr_80C97C_Surfs->field_0 = v4->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12884 ptr_80C97C_Surfs->field_C = v4->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12885 ptr_80C97C_Surfs->field_10 = v4->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12886 LOBYTE(v7) = (char)pSurfs + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12887 if ( ptr_80C97C_Surfs < &pSurfs[1999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12889 ++ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12890 ++pOutdoorCamera->uNumSurfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12891 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12892 if ( BYTE3(a4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12893 v4->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12895 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12898 return v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12899 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12900
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12901
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12902
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12903 //----- (0043F953) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904 int __cdecl PrepareWallsRenderList_BLV()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12906 pStru170->uNumFaceIDs = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12907 if ( pBLVRenderParams->uRadius )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12909 pStru170->field_FA8[0].uSectorID = LOWORD(pBLVRenderParams->uRadius);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12910 pStru170->field_FA8[0].uViewportW = LOWORD(pBLVRenderParams->uViewportW);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12911 pStru170->field_FA8[0].uViewportZ = LOWORD(pBLVRenderParams->uViewportZ);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12912 pStru170->field_FA8[0].uViewportY = LOWORD(pBLVRenderParams->uViewportY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12913 pStru170->field_FA8[0].uViewportX = LOWORD(pBLVRenderParams->uViewportX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12914 pStru170->field_FA8[0].field_C._43F9E1(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12915 SLOWORD(pBLVRenderParams->uViewportX),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12916 SLOWORD(pBLVRenderParams->uViewportY),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12917 SLOWORD(pBLVRenderParams->uViewportZ),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12918 SLOWORD(pBLVRenderParams->uViewportW));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12919 pStru170->field_FA8[0].uFaceID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12920 pStru170->field_FA8[0].std__vector_0007A8 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12921 pStru170->std__vector_000FA8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12922 sub_440639(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12924 return pStru170->RenderWalls();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12926
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12927 //----- (0043F9E1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12928 __int16 *stru170_stru2::_43F9E1(__int16 x, int y, __int16 z, int w)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 signed int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12931 __int16 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 auto a2 = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934 auto a3 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 auto a4 = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 auto a5 = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 this->_viewport_space_y = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939 this->field_4 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941 result = this->array_3D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 if ( v5 < a3 || v5 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 *result = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 *(result - 480) = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 *(result - 480) = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 *result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 while ( v5 < 480 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 //----- (0043FA33) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962 void __fastcall PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964 LevelDecoration *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 DecorationDesc *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 __int16 v4; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969 int v7; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12970 unsigned int v8; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971 int v9; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12972 int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 SpriteFrame *v11; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974 SpriteFrame *v12; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 int v14; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12977 RenderBillboard *v15; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 char v16; // zf@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979 IndoorCameraD3D **v17; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12980 double v18; // st7@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 float v19; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12982 signed __int64 v20; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12983 signed __int64 v21; // qtt@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984 int v22; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12985 int v23; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12986 Particle_ local_0; // [sp+Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12987 double v25; // [sp+74h] [bp-38h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 unsigned int v26; // [sp+7Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 int a2; // [sp+80h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12990 int a3; // [sp+84h] [bp-28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 int a1; // [sp+88h] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 int v30; // [sp+8Ch] [bp-20h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12993 float v31; // [sp+90h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 int a5; // [sp+94h] [bp-18h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12995 int z; // [sp+98h] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12996 int a6; // [sp+9Ch] [bp-10h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997 int y; // [sp+A0h] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998 int x; // [sp+A4h] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999 int v37; // [sp+A8h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 v26 = uDecorationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002 LODWORD(v31) = uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 v2 = &pLevelDecorations[uDecorationID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004 if ( !(v2->field_2 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13006 v3 = &pDecorationList->pDecorations[v2->uDecorationDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007 v4 = v3->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008 if ( (char)v4 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 if ( !(v4 & DECORATION_DONT_DRAW) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 v6 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 v7 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014 a2 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 a1 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 a3 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017 v8 = v2->field_10_y_rot
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 + ((signed int)stru_5C6E00->uIntegerPi >> 3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 - stru_5C6E00->Atan2(v6 - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 v37 = pBLVRenderParams->field_0_timer_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023 v37 = pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 v10 = abs(v2->vPosition.x + v2->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 v11 = pSpriteFrameTable->GetFrame(v3->uSpriteID, v37 + v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 v13 = v11->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 if ( v13 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 v30 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 if ( v13 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032 v30 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13033 if ( v13 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13034 LOBYTE(v30) = v30 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13035 if ( (256 << v9) & v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13036 v30 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(a1, a2, a3, &x, &y, &z, 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 v14 = abs(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 if ( v14 >= abs(y) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13042 pGame->pIndoorCameraD3D->Project(x, y, z, &a5, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 v15 = &pBillboardRenderList[uNumBillboardsToDraw];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 if ( (signed int)uNumBillboardsToDraw < 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13047 ++uNumDecorationsDrawnThisFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 v16 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 v15->uHwSpriteID = v12->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13050 v15->uPalette = v12->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13051 v15->uIndoorSectorID = LOWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13052 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054 LODWORD(v21) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13055 HIDWORD(v21) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13056 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13057 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13058 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13059 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v21 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13062 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064 v17 = &pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 v15->flt_8 = pGame->pIndoorCameraD3D->flt_D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 v18 = (*v17)->flt_D4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13067 v19 = v15->flt_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13068 v15->flt_C = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069 v31 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070 v25 = v19 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13072 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13073 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13074 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13075 v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13076 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13077 v31 = v15->flt_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13078 v25 = v31 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13080 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13084 HIWORD(v22) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13085 v15->field_4 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13086 v15->field_1E = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13087 v15->field_20 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13088 v15->field_22 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13089 v15->field_24 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13090 v15->field_26 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13091 v15->field_28 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13092 v23 = 8 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13093 LOBYTE(v23) = 8 * v26 | 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13094 LOWORD(v22) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 v15->field_2C_prolly_tint = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13096 v15->sZValue = v22 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13097 v15->pSpriteFrame = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105 memset(&local_0, 0, 0x68u); // fire, like at the Pit's tavern
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13106 v5 = (double)v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13107 local_0.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13108 local_0.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13109 local_0.x = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13110 local_0.y = (double)v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13111 local_0.z = (double)v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 local_0.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 local_0.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 local_0.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115 local_0.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 local_0.field_20 = (rand() & 0x80) + 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13118 pGame->pParticleEngine->AddParticle(&local_0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13124 //----- (0044028F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125 void __cdecl PrepareItemsRenderList_BLV()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13127 char *v0; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13128 ObjectDesc *v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13129 __int16 v2; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13130 RenderBillboard *v3; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13131 SpriteFrame *v4; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13132 SpriteFrame *v5; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13133 unsigned int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13134 int v7; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13135 int v8; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13136 int v9; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137 unsigned __int16 v10; // ax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 int *v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13139 char v12; // zf@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13140 IndoorCameraD3D **v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13141 double v14; // st7@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13142 float v15; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13143 double v16; // ST30_8@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13144 signed __int64 v17; // qtt@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13145 int v18; // ST5C_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13146 signed __int64 v19; // qtt@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13147 int v20; // ST5C_4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13148 int v21; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13149 __int16 v22; // ax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13150 int v23; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151 SpriteFrame *v24; // [sp+1Ch] [bp-40h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13152 ObjectDesc *v25; // [sp+20h] [bp-3Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13153 __int16 a5; // [sp+28h] [bp-34h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13154 int a6; // [sp+2Ch] [bp-30h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 int a2; // [sp+30h] [bp-2Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13156 int a1; // [sp+34h] [bp-28h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13157 int v30; // [sp+38h] [bp-24h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13158 int v31; // [sp+38h] [bp-24h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13159 signed int v32; // [sp+3Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13160 int a3; // [sp+40h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13161 signed __int16 v34; // [sp+44h] [bp-18h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13162 int v35; // [sp+48h] [bp-14h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13163 int v36; // [sp+4Ch] [bp-10h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13164 signed int z; // [sp+50h] [bp-Ch]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13165 signed int y; // [sp+54h] [bp-8h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13166 signed int x; // [sp+58h] [bp-4h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13168 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13169 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13171 v0 = (char *)&pLayingItems[0].uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13174 if ( *((short *)v0 - 13) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13176 v1 = &pObjectList->pObjects[*((short *)v0 - 13)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13177 v25 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13178 if ( !(v1->uFlags & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13180 if ( ((v2 = *((short *)v0 - 14), v2 < 1000) || v2 >= 10000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181 && (v2 < 500 || v2 >= 600)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13182 && (v2 < 811 || v2 >= 815)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13183 || pGame->pStru6Instance->_4A81CA((LayingItem *)(v0 - 28)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13185 a5 = *(short *)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13186 a1 = *((int *)v0 - 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13187 a2 = *((int *)v0 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13188 a3 = *((int *)v0 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 v3 = &pBillboardRenderList[uNumBillboardsToDraw];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190 v4 = pSpriteFrameTable->GetFrame(v1->uSpriteID, *((short *)v0 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 v24 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193 v30 = v4->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194 a6 = v4->uGlowRadius * *((short *)v0 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195 v6 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 *((int *)v0 - 6) - pBLVRenderParams->vPartyPos.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 *((int *)v0 - 5) - pBLVRenderParams->vPartyPos.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 LOWORD(v7) = *((short *)v0 - 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13199 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13200 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13201 v10 = v5->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13202 v3->uHwSpriteID = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13203 if ( v30 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 a3 -= (signed int)((unsigned __int64)(v5->scale
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 * (signed __int64)pSprites_LOD->pSpriteHeaders[(signed __int16)v10].uHeight) >> 16) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13209 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13210 if ( v8 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13211 v34 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13212 if ( v8 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13213 v34 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 if ( v8 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 LOBYTE(v34) = v34 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216 v11 = (int *)(256 << v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13217 if ( (256 << v9) & v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13218 v34 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13219 if ( a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13221 LOBYTE(v11) = byte_4E94D3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 pMobileLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13226 a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13227 a6,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13228 v25->uParticleTrailColorR,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13229 v25->uParticleTrailColorG,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230 v25->uParticleTrailColorB,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13231 v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13234 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13235 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13236 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13237 &x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13238 &y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13239 &z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13240 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13242 pGame->pIndoorCameraD3D->Project(x, y, z, &v36, &v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13243 if ( (signed int)uNumBillboardsToDraw >= 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13244 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13245 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13246 ++uNumSpritesDrawnThisFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13247 *(v0 - 2) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13248 v12 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13249 v3->uPalette = v24->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13250 v3->uIndoorSectorID = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13251 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13253 LODWORD(v19) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13254 HIDWORD(v19) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13255 v20 = v19 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13256 v3->field_0 = (unsigned __int64)(v24->scale * v19 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13257 v31 = (unsigned __int64)(v24->scale * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13259 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13261 v13 = &pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13262 v3->flt_8 = pGame->pIndoorCameraD3D->flt_D0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13263 v14 = (*v13)->flt_D4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13264 v15 = v3->flt_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13265 v3->flt_C = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13266 v16 = v15 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13267 LODWORD(v17) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13268 HIDWORD(v17) = SLOWORD(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13269 v18 = v17 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13270 v3->field_0 = (unsigned __int64)(v24->scale * v17 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13271 v31 = (unsigned __int64)(v24->scale * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13273 HIWORD(v21) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13274 v3->field_4 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13275 v3->field_1E = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13276 v3->field_20 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13277 v3->field_22 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13278 v3->field_24 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13279 v3->field_26 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13280 v22 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13281 v3->field_2C_prolly_tint = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13282 v3->field_28 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13283 LOWORD(v21) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13284 v23 = 8 * v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13285 LOBYTE(v23) = 8 * v32 | 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13286 v3->pSpriteFrame = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13287 v12 = (*(v0 - 2) & 0x20) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13288 v3->sZValue = v21 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13289 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13291 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13292 v3->sZValue = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 ++v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13299 v0 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13301 while ( v32 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13304
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13305
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13306
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13307 //----- (00440639) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13308 void __fastcall sub_440639(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312 BLVSector *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13314 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316 v3 = &pIndoor->pSectors[pStru170->field_FA8[a1].uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13320 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13321 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13322 pStru170->_4B0EA8(v1, v3->pFaceIDs[v2++]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13323 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13326 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13328 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331 pStru170->_4AFB86(v1, v3->pFaceIDs[v2++]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 if ( v3->field_0 & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336 sub_4406BC(v1, v3->uFirstBSPNode);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13338
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 //----- (004406BC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340 void __fastcall sub_4406BC(int a1, unsigned int uFirstNode)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342 BLVSector *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13343 BSPNode *v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13344 BLVFace *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13345 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13346 __int16 v6; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347 int v7; // ebp@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 int v8; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349 __int16 v9; // di@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13350 int v10; // [sp+10h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351 bool v11; // [sp+14h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13352 stru170_stru0 *v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13354 v10 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13355 v12 = &pStru170->field_FA8[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13356 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13358 v2 = &pIndoor->pSectors[v12->uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13359 v3 = &pIndoor->pNodes[uFirstNode];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13360 v4 = &pIndoor->pFaces[v2->pFaceIDs[v3->uCoplanarOffset]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13361 v5 = v4->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13362 + pBLVRenderParams->vPartyPos.x * v4->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13363 + pBLVRenderParams->vPartyPos.y * v4->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 + pBLVRenderParams->vPartyPos.z * v4->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 if ( v4->uAttributes & 1 && v4->uSectorID != v12->uSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13366 v5 = -v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13367 v11 = v5 > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13368 if ( v5 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13369 v6 = v3->uFront;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13370 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13371 v6 = v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13372 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13373 sub_4406BC(v10, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13374 v7 = v3->uCoplanarOffset;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13375 v8 = v7 + v3->uCoplanarSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13376 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13378 while ( v7 < v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 pStru170->_4B0EA8(v10, v2->pFaceIDs[v7++]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13383 while ( v7 < v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 pStru170->_4AFB86(v10, v2->pFaceIDs[v7++]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13386 v9 = v11 ? v3->uFront : v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13387 if ( v9 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13388 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13389 uFirstNode = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13392
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13393 //----- (00440DF5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13394 int stru167_wrap::Push(__int16 a2, __int16 a3, __int16 a4, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13396 stru167_wrap *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13397 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13398
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13400 v6->pElements[v6->uNumElements].field_6 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13401 this->pElements[this->uNumElements].field_8 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13402 this->pElements[this->uNumElements].field_A = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13403 v6->pElements[v6->uNumElements].field_C = rand() % 64 + 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13404 v6->pElements[v6->uNumElements].field_E = v6->pElements[v6->uNumElements].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13405 result = 3 * v6->uNumElements;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13406 v6->pElements[v6->uNumElements++].bgr16 = bgr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13407 if ( v6->uNumElements >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13408 v6->uNumElements = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13409 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13411
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13412 //----- (00440E91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 void stru167_wrap::_440E91(__int16 x, int y, int z, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 stru167_wrap *v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416 int i; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 int v8; // ST08_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13418 int v9; // ST04_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13419 int v10; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13420
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13421 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13422 for ( i = 0; i < rand() % 6 + 5; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13424 v8 = z + rand() % 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13425 v9 = rand() % 33 + y - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13426 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13427 Push(v10 % 33 + x - 16, v9, v8, a5, bgr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431 //----- (00440F07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 void stru167_wrap::_440F07()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434 char *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13435 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13437 v1 = (char *)&this->pElements[0].field_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13438 v2 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13439 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13441 if ( *((short *)v1 + 3) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13443 *((short *)v1 + 2) += rand() % 5 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13444 *(short *)v1 += rand() % 5 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13445 *((short *)v1 + 1) += rand() % 5 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13446 *((short *)v1 + 3) -= LOWORD(pEventTimer->uTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 v1 += 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 --v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 while ( v2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13453
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13454 //----- (0044100D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13455 bool __cdecl sub_44100D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13456 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13457 return pCurrentScreen == 4
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13458 || pCurrentScreen == 7
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13459 || pCurrentScreen > 12
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13460 && (pCurrentScreen <= 14
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13461 || pCurrentScreen > 16
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13462 && (pCurrentScreen <= 18
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13463 || pCurrentScreen == 23));
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13464 }
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13465 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 //----- (00441498) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 void __cdecl GameUI_DrawTorchlightAndWizardEye()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13470 unsigned int v0; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471 IconFrame *v1; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472 unsigned int v2; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 IconFrame *v3; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13475 if ( !pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13476 || pCurrentScreen == 1
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13477 || pCurrentScreen == 2
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13478 || pCurrentScreen == 5
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13479 || pCurrentScreen == 8
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13480 || pCurrentScreen == 10
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13481 || pCurrentScreen == 11
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13482 || pCurrentScreen == 12
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13483 || pCurrentScreen == 15
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13484 || pCurrentScreen == 3
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13485 || pCurrentScreen == 19 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13487 if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488 && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 v0 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 v1 = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493 pUIAnum_Torchlight->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13494 pUIAnum_Torchlight->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 &pIcons_LOD->pTextures[v1->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13496 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497 if ( SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13498 && (SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[19].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13500 v2 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 v3 = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13503 pUIAnim_WizardEye->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13504 pUIAnim_WizardEye->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13505 &pIcons_LOD->pTextures[v3->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13508 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13509 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13510
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13511 //----- (0044158F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13512 void __cdecl GameUI_DrawCharacterSelectionFrame()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13514 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13515 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13516 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing__negindex[uActiveCharacter] - 9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13517 0x17Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13518 &pIcons_LOD->pTextures[dword_50C98C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13520 // 4ED746: using guessed type __int16 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing__negindex[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13521 // 50C98C: using guessed type int dword_50C98C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13522
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13523 //----- (004415C5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13524 void __cdecl Load_isn_spells_21_27()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13526 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13527 char pContainer[120]; // [sp+8h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 sprintf(pContainer, "isn-%02d", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533 pTextureIDs_isns[v0++] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 while ( v0 < 14 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13536 uIconIdx_Spell21 = pIconsFrameTable->FindIcon("spell21");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13537 uIconIdx_Spell27 = pIconsFrameTable->FindIcon("spell27");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 //----- (0044162D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 void __cdecl GameUI_DrawPartySpells()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13543 unsigned int v0; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13544 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13545 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13546 int v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 __int16 *v4; // ebx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13548 Player *v5; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13549 unsigned int v6; // [sp-4h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 Texture *v7; // [sp-4h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 unsigned int v8; // [sp-4h] [bp-1Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13552 Texture *v9; // [sp-4h] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13553 Player **v10; // [sp+10h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13554
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 v0 = (signed __int64)((double)GetTickCount() * 0.050000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13556 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13559 v2 = (unsigned __int8)byte_4E5DD8[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 if ( SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561 && (SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563 v3 = pTextureIDs_isns[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13564 pRenderer->_4A65CC(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13565 pPartySpellbuffsUI_XYs[v1][0],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13566 pPartySpellbuffsUI_XYs[v1][1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567 (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13569 v0 + 20 * pPartySpellbuffsUI_smthns[v1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571 63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 while ( v1 < 14 );
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13576 if ( !pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13577 || pCurrentScreen == 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13579 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13581 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13582 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13583 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell21, v6)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13586 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13587 pRenderer->DrawTextureIndexed(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 pRenderer->DrawTextureTransparent(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13591 if ( SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 && (SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[18].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 if ( pParty->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13595 v8 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13596 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13597 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13598 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell27, v8)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600 pRenderer->DrawTextureIndexed(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602 pRenderer->DrawTextureTransparent(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604 }
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13605
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13606 uint _it = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 v10 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13608 v4 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611 v5 = *v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13612 if ( (signed __int64)(*v10)->pPlayerBuffs[6].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13613 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615 0x1ABu,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13616 (Texture *)(dword_507964 != -1 ? &pIcons_LOD->pTextures[dword_507964] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 if ( (signed __int64)v5->pPlayerBuffs[1].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13618 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13619 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13620 0x189u,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13621 (Texture *)(dword_50796C != -1 ? &pIcons_LOD->pTextures[dword_50796C] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13622 if ( (signed __int64)v5->pPlayerBuffs[11].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625 0x19Au,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13626 (Texture *)(dword_507968 != -1 ? &pIcons_LOD->pTextures[dword_507968] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 if ( (signed __int64)v5->pPlayerBuffs[10].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13628 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630 0x1BCu,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13631 (Texture *)(dword_507960 != -1 ? &pIcons_LOD->pTextures[dword_507960] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13633 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13634 }
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13635 //while ( (signed int)v4 < (signed int)pBaseHealthByClass );
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13636 while (++_it != 4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13639
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 //----- (00441A4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641 __int16 __fastcall sub_441A4E(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13643 __int16 result; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645 char *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646 int v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13648 SpriteFrame *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 SpriteFrame *v7; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13650 int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13651 unsigned __int16 v9; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652 RenderBillboardTransform_local0 v10; // [sp+Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653 int v11; // [sp+5Ch] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13654 int v12; // [sp+60h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13655 int v13; // [sp+64h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13656
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657 v10.uParentBillboardID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658 v10.pTarget = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13659 v10.pTargetZ = pRenderer->pActiveZBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13660 v10.uTargetPitch = pRenderer->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13661 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13662 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13663 v10.uViewportX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13664 v10.uViewportY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13665 v10.uViewportZ = 639;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 v10.uViewportW = 479;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13667 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13668 v3 = (char *)&pOtherOverlayList->pOverlays[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13669 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13671 if ( *((short *)v3 - 3) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13673 result = *((short *)v3 - 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674 if ( result >= 300 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676 v4 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13677 v5 = result == v2 + 320 | result == v2 + 330 | result == v2 + 340 | result == v2 + 350;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13678 result = v2 + 310;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13679 if ( v4 == v2 + 310 | v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13681 if ( !*(short *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683 v6 = pSpriteFrameTable->GetFrame(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13684 pOverlayList->pOverlays[*((short *)v3 - 5)].uSpriteFramesetID,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13685 *((short *)v3 - 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 v11 = *((int *)v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13688 v13 = v6->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689 v13 = (unsigned __int64)(v11 * (signed __int64)v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 v10.field_8 = *((short *)v3 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691 v10.field_C = *((short *)v3 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692 v10.field_10 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693 v10.field_14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694 v10.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v6->uPaletteIndex, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13695 v8 = *((short *)v3 - 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13696 v10.field_28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13697 v10.uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13698 v9 = pOverlayList->pOverlays[v8].uOverlayType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13699 if ( !v9 || v9 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 v10.field_C += pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]].uHeight >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13701 result = pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]]._4AD2D1(&v10, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13702 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 if ( v12 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 v3 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 while ( (signed int)v3 < (signed int)&pOverlayList->pOverlays );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 //----- (00441D38) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718 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
13719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720 int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 BLVFace *v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722 unsigned int *v8; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 unsigned int v9; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724 unsigned int v10; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 __int16 v11; // cx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726 int v12; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 unsigned int v13; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728 unsigned int v14; // ebx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730 unsigned int *v16; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 __int16 v17; // di@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732 double v18; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 float v19; // ST38_4@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13734 double v20; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13735 double v21; // st6@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13736 double v22; // st5@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13737 float v23; // ST3C_4@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738 double v24; // ST20_8@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13739 double v25; // ST20_8@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740 unsigned __int16 *v26; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 signed int v27; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742 unsigned __int16 *v28; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 signed int v29; // edi@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13744 int v30; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 unsigned __int16 *v31; // ebx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746 signed int v32; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 signed int v33; // ebx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748 unsigned int v34; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 signed int v35; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 unsigned __int16 v36; // di@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13751 int v37; // edi@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13752 int v38; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13753 __int16 v39; // ax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13754 int v40; // edi@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13755 int v41; // ebx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756 unsigned int v42; // eax@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757 unsigned int v43; // ebx@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 unsigned int v44; // ST30_4@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13759 char *v45; // ebx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13760 int v46; // edi@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13761 int v47; // eax@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13762 unsigned int v48; // ebx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13763 unsigned int v49; // ST64_4@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13764 double v50; // ST20_8@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13765 unsigned int v51; // [sp-10h] [bp-64h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13766 unsigned int v52; // [sp-10h] [bp-64h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13767 unsigned int v53; // [sp-Ch] [bp-60h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13768 unsigned int v54; // [sp-Ch] [bp-60h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13769 unsigned int v55; // [sp-8h] [bp-5Ch]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13770 unsigned int v56; // [sp-8h] [bp-5Ch]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13771 signed int v57; // [sp-4h] [bp-58h]@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13772 unsigned __int16 v58; // [sp-4h] [bp-58h]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 unsigned __int16 v59; // [sp-4h] [bp-58h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 unsigned __int16 v60; // [sp+10h] [bp-44h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 unsigned int v61; // [sp+10h] [bp-44h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13776 unsigned __int16 *v62; // [sp+14h] [bp-40h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13777 unsigned int v63; // [sp+14h] [bp-40h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13778 int v64; // [sp+18h] [bp-3Ch]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13779 unsigned int v65; // [sp+18h] [bp-3Ch]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13780 unsigned int lPitch; // [sp+20h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13781 unsigned int lPitcha; // [sp+20h] [bp-34h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13782 char *lPitchb; // [sp+20h] [bp-34h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13783 unsigned int v69; // [sp+24h] [bp-30h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13784 signed int v70; // [sp+24h] [bp-30h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13785 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13786 signed int uBluea; // [sp+28h] [bp-2Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13787 int v73; // [sp+2Ch] [bp-28h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13788 unsigned __int8 *v74; // [sp+30h] [bp-24h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13789 signed int v75; // [sp+34h] [bp-20h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13790 int v76; // [sp+34h] [bp-20h]@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13791 int v77; // [sp+34h] [bp-20h]@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792 signed int v78; // [sp+38h] [bp-1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13793 int v79; // [sp+38h] [bp-1Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13794 bool v80; // [sp+3Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13795 unsigned int a2; // [sp+40h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13796 int a2a; // [sp+40h] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13797 signed int a2b; // [sp+40h] [bp-14h]@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13798 char *a2c; // [sp+40h] [bp-14h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13799 unsigned int a3; // [sp+44h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13800 int a3a; // [sp+44h] [bp-10h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13801 signed int uHeight; // [sp+48h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13802 signed int uWidth; // [sp+4Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13803 signed int uZa; // [sp+5Ch] [bp+8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13804 signed int uZb; // [sp+5Ch] [bp+8h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13805 signed int uZc; // [sp+5Ch] [bp+8h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13806 signed int uZd; // [sp+5Ch] [bp+8h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13807 signed int uZe; // [sp+5Ch] [bp+8h]@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13808 signed int uZf; // [sp+5Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13809 signed int uZg; // [sp+5Ch] [bp+8h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 unsigned int uWa; // [sp+60h] [bp+Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13811 float uWb; // [sp+60h] [bp+Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812 float uWe; // [sp+60h] [bp+Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13813 unsigned __int16 *uWc; // [sp+60h] [bp+Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13814 unsigned int uWd; // [sp+60h] [bp+Ch]@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13815 float uZooma; // [sp+64h] [bp+10h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816 signed int flagsa; // [sp+68h] [bp+14h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13817 unsigned int flagsb; // [sp+68h] [bp+14h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13818 char *flagsc; // [sp+68h] [bp+14h]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13819 unsigned int flagsd; // [sp+68h] [bp+14h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13820
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13821 a3 = uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13822 a2 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13823 uWidth = (signed int)(uX + uZ) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13824 uHeight = (signed int)(uY + uW) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13825 lPitch = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13826 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13828 v80 = (signed __int64)pParty->pPartyBuffs[19].uExpireTime > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13829 v75 = pParty->pPartyBuffs[19].uSkill;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13830 if ( CheckHiredNPCSpeciality(0x26u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13832 v80 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835 pRenderer->Clip_v2(a2, a3, uZ - 1, uW - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13836 v6 = uW - a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13837 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13839 uZc = uZ - a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13840 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13841 v74 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 v62 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13843 v73 = (1 << (v17 + 16)) / (signed int)uZoom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 v18 = (double)(1 << (16 - v17));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13845 v19 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13846 v20 = (double)(pParty->vPosition.x + 32768) / v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13847 v21 = (double)(32768 - pParty->vPosition.z) / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13848 uWb = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 if ( uZoom == 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13851 v20 = v20 - (double)(uZc / 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 v22 = (double)(v6 / 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13854 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 if ( uZoom == 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13857 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13858 v20 = v20 - (double)(uZc / 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13859 v22 = (double)(v6 / 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13861 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13863 if ( uZoom != 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13864 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 v20 = v20 - (double)(uZc / 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 v22 = (double)(v6 / 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 uWb = v21 - v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13870 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13871 v23 = v20 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13872 v24 = v23 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13873 v70 = LODWORD(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13874 uWe = uWb * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13875 v25 = uWe + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13876 v78 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13877 uBluea = LODWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13878 v26 = (unsigned __int16 *)_56EFD8_minimap;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13879 v27 = SLODWORD(v25) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13880 uWc = (unsigned __int16 *)_56EFD8_minimap;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13881 v28 = &pRenderer->pTargetSurface[a2 + a3 * lPitch];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13882 if ( flags )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13884 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13885 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13886 v64 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13887 if ( v6 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13889 a3a = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13890 v29 = v70 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13891 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13893 a2b = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13894 if ( uZc > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13896 v30 = (int)&v74[v27 * v64];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13897 flagsa = uZc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13898 a2b = uZc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13899 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13901 v31 = uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13902 ++uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13903 *v31 = v62[*(char *)(v30 + v29)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13904 v78 += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13905 v29 = v78 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13906 --flagsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13908 while ( flagsa );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13910 v78 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13911 v29 = v70 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13912 v28 += 137 - a2b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13913 uBluea += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13914 v27 = uBluea >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13915 --a3a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13917 while ( a3a );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13921 uZd = 117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13922 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13924 v32 = 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13925 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13927 *v28 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13928 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13929 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13930 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13932 while ( v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13933 v28 += lPitch - 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13934 --uZd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13936 while ( uZd );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13937 uNumBlueFacesInBLVMinimap = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13938 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13940 pRenderer->FillRect2(v6, a2, a3, uZ - a2, v6, 0xFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13941 uNumBlueFacesInBLVMinimap = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13942 uZa = 0;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13943 if ( (signed int)pIndoor->pMapVertices->uNumVertices > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13945 a2a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13946 v7 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13947 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13948 {
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13949 v8 = (uint *)&pIndoor->pMapVertices->pVertices[a2a];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13950 v9 = v7[LOWORD(pIndoor->pMapVertices[a2a + 2])].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13951 if ( !(BYTE1(v9) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13953 v10 = v7[HIWORD(pIndoor->pMapVertices[a2a + 2])].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13954 if ( !(BYTE1(v10) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13956 v11 = HIWORD(pIndoor->pMapVertices[a2a + 3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13957 if ( v11 & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13958 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13959 if ( (v9 & 0x80u) != 0 || (v10 & 0x80u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13960 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13963 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13964 ++uZa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13965 a2a += 3;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
13966 if ( uZa >= (signed int)pIndoor->pMapVertices->uNumVertices )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13967 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13969 HIWORD(pIndoor->pMapVertices[a2a + 3]) = v11 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 pIndoor->_visible_outlines[uZa >> 3] |= 1 << (7 - uZa % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13971 v7 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13973 if ( v80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13974 && v75 >= 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13975 && ((v12 = (int)&v7[*((short *)v8 + 2)], *(int *)(v12 + 44) & 0x2000000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 || v7[*((short *)v8 + 3)].uAttributes & 0x2000000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13977 && (pIndoor->pFaceExtras[*(short *)(v12 + 72)].uEventID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 || pIndoor->pFaceExtras[v7[*((short *)v8 + 3)].uFaceExtraID].uEventID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13979 && (v13 = uNumBlueFacesInBLVMinimap, (signed int)uNumBlueFacesInBLVMinimap < 49) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13981 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap] = uZa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13982 uNumBlueFacesInBLVMinimap = v13 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13984 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13986 v69 = uWidth
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13987 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13988 * (signed __int64)pIndoor->pVertices[*(short *)v8].x) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13989 - uZoom * pParty->vPosition.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13990 lPitcha = uHeight
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13991 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13992 * (signed __int64)pIndoor->pVertices[*(short *)v8].y) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13993 - uZoom * pParty->vPosition.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13994 uWa = uWidth
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13996 * (signed __int64)pIndoor->pVertices[*((short *)v8 + 1)].x) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13997 - uZoom * pParty->vPosition.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13998 v14 = uHeight
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13999 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14000 * (signed __int64)pIndoor->pVertices[*((short *)v8 + 1)].y) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14001 - uZoom * pParty->vPosition.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14002 v15 = abs(*((short *)v8 + 4) - pParty->vPosition.y) / 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14003 if ( v15 > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14004 v15 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14005 pRenderer->FillRect(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14006 v7 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14008 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14010 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14011 for ( uZb = 0; uZb < (signed int)uNumBlueFacesInBLVMinimap; ++uZb )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14012 {
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14013 v16 = (uint *)&pIndoor->pMapVertices->pVertices[3 * pBlueFacesInBLVMinimapIDs[uZb]];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14014 pRenderer->FillRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14015 uWidth
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14017 * (signed __int64)pIndoor->pVertices[*(short *)v16].x) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14018 - uZoom * pParty->vPosition.x) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 uHeight
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14021 * (signed __int64)pIndoor->pVertices[*(short *)v16].y) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14022 - uZoom * pParty->vPosition.z) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14023 uWidth
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14024 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14025 * (signed __int64)pIndoor->pVertices[HIWORD(pIndoor->pMapVertices[3 * pBlueFacesInBLVMinimapIDs[uZb] + 1])].x) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026 - uZoom * pParty->vPosition.x) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14027 uHeight
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14028 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029 * (signed __int64)pIndoor->pVertices[HIWORD(pIndoor->pMapVertices[3 * pBlueFacesInBLVMinimapIDs[uZb] + 1])].y) >> 16) << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14030 - uZoom * pParty->vPosition.z) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14031 uBlue);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033 LABEL_50:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14035 v34 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14036 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14037 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) < 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14038 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039 if ( (signed int)v34 <= 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14041 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14042 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14044 if ( (signed int)v34 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14046 if ( (signed int)v34 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14048 if ( (signed int)v34 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14050 if ( (signed int)v34 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14052 if ( (signed int)v34 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14054 if ( (signed int)v34 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14055 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14056 v57 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14057 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14058 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14060 v57 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14063 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14064 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14065 v57 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14068 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14070 v57 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14073 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14074 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14075 v57 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 v57 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14081 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14082 v35 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14083 LABEL_66:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14084 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14085 uWidth - 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14086 uHeight - 3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087 (Texture *)(pTextureIDs_pMapDirs[v35] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v35]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14089 flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14090 v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091 if ( v80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 uZe = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096 a2c = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14097 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14099 if ( !*((short *)a2c - 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14100 || !*(short *)a2c
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14101 || v75 == 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 || (v37 = ((unsigned __int64)((*(int *)(a2c + 2) - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14103 + uWidth,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14104 v79 = (unsigned __int64)((*(int *)(a2c + 6) - pParty->vPosition.z) * (signed __int64)(signed int)uZoom) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 v38 = uHeight - v79,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 v37 < pRenderer->field_1C_clipx)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 || v37 > pRenderer->field_24_clipz
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 || v38 < pRenderer->field_20_clipy
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14109 || v38 > pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14110 goto LABEL_83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111 if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14113 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14115 pRenderer->FillRect(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14116 pRenderer->FillRect(v37, v38 - 2, v37, v38 + 1, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14117 pRenderer->FillRect(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14118 pRenderer->FillRect(v37 - 2, v38, v37 - 2, v38 + 1, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14119 v37 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14120 v58 = flagsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14121 v55 = v38 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14122 goto LABEL_81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14124 pRenderer->FillRect(v37 - 1, v38 - 1, v37 - 1, uHeight - v79, flagsb);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14125 v58 = flagsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14126 v55 = uHeight - v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14127 v53 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14128 v51 = v38 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14129 LABEL_82:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14130 pRenderer->FillRect(v37, v51, v53, v55, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 LABEL_83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14132 ++uZe;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14133 a2c += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14134 if ( uZe >= (signed int)uNumLayingItems )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14136 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14137 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14138 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 v58 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14142 v55 = uHeight - v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14143 LABEL_81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14144 v53 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14145 v51 = uHeight - v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14146 goto LABEL_82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14148 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14149 v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, 0, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14150 v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 v65 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 uZf = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14153 if ( (signed int)uNumActors > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14155 flagsc = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14158 v39 = *(short *)flagsc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14159 if ( *(short *)flagsc != 11 && v39 != 19 && (v39 == 5 || *(flagsc - 139) & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14161 v40 = ((unsigned __int64)(((signed int)*((short *)flagsc - 17) - pParty->vPosition.x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 * (signed __int64)(signed int)uZoom) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14163 + uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14164 v76 = (unsigned __int64)(((signed int)*((short *)flagsc - 16) - pParty->vPosition.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14165 * (signed __int64)(signed int)uZoom) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 v41 = uHeight - v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 if ( v40 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 if ( v40 <= pRenderer->field_24_clipz && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14171 uWd = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14172 if ( *(flagsc - 137) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 uWd = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14174 if ( *(short *)flagsc == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14175 uWd = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 if ( (signed int)uZoom > 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14178 pRenderer->FillRect(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14179 pRenderer->FillRect(v40, v41 - 2, v40, v41 + 2, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14180 pRenderer->FillRect(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 v42 = v41 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14182 v43 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14184 pRenderer->FillRect(v40 - 2, v43, v40 - 2, v42, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14185 v40 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186 v59 = uWd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 v56 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14188 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14189 v52 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 pRenderer->FillRect(v40 - 1, v41 - 1, v40 - 1, uHeight - v76, uWd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14194 v59 = uWd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14195 v56 = uHeight - v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 v52 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14199 pRenderer->FillRect(v40, v52, v54, v56, v59);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203 ++uZf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204 flagsc += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14206 while ( uZf < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14211 flagsd = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 uZg = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213 if ( (signed int)uNumLevelDecorations > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 v45 = (char *)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216 lPitchb = (char *)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 if ( *(v45 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221 v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14222 + uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14223 v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.z) * (signed __int64)(signed int)uZoom) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14224 v47 = uHeight - v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 if ( v46 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 if ( v46 <= pRenderer->field_24_clipz && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14231 v48 = v47 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232 v49 = v47 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233 pRenderer->FillRect(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 pRenderer->FillRect(v46, v49, v46, v48, flagsd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235 pRenderer->FillRect(v46 + 1, v49, v46 + 1, v48, flagsd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236 v45 = lPitchb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14240 pRenderer->FillRect(v46, uHeight - v77, v46, uHeight - v77, flagsd);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245 ++uZg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14246 v45 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14247 lPitchb = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14249 while ( uZg < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 v33,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 (Texture *)(dword_5079D8 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079D8] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256 uZooma = (double)pParty->sRotationY * 0.1171875;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257 v50 = uZooma + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258 pRenderer->Clip(0x21Du, v33, 0x237u, 0x1E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 LODWORD(v50) + 285,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 0x88u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 (Texture *)(dword_5079B4 != -1 ? (int)&pIcons_LOD->pTextures[dword_5079B4] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263 pRenderer->ResetClip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267 //----- (00442955) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 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
14269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271 int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 unsigned int *v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273 unsigned __int8 v8; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 unsigned __int8 v9; // sf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 unsigned int v11; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277 __int16 v12; // cx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 signed int v13; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280 Vec3_short_ *v15; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 int v16; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 Vec3_short_ *v18; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 int v19; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285 int v20; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 signed int v21; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287 int v22; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 Vec3_short_ *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290 Vec3_short_ *v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291 int v26; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 unsigned __int16 *v27; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 int v28; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 int v29; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 double v30; // st7@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 signed __int64 v31; // qax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 char *v32; // edx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 int v33; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299 signed int v34; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300 signed int v35; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301 int v36; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302 int v37; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 int v38; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 unsigned int v39; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305 const void *v40; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14306 unsigned __int16 *v41; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 unsigned __int8 v42; // cf@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 unsigned int v43; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309 int v44; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310 int v45; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311 int v46; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 signed int v47; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 signed int v48; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 int v49; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315 signed int v50; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14316 unsigned int v51; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 int result; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 int v53; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 int v54; // esi@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320 int v55; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321 __int16 v56; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 double v57; // st7@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323 int v58; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 signed __int64 v59; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325 signed int v60; // edi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 signed __int64 v61; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 signed int v62; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 signed int v63; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 int v64; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 unsigned int v65; // ebx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331 char *v66; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332 unsigned __int16 *v67; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 int v68; // edi@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 unsigned __int16 v69; // cx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335 unsigned int v70; // [sp-10h] [bp-48074h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 unsigned int v71; // [sp-Ch] [bp-48070h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 unsigned int v72; // [sp-8h] [bp-4806Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338 signed int v73; // [sp-4h] [bp-48068h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 char v75; // [sp+Ch] [bp-48058h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 int v76; // [sp+4800Ch] [bp-58h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 unsigned __int16 *v78; // [sp+48014h] [bp-50h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 unsigned int v79; // [sp+48018h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14345 unsigned int y_; // [sp+4801Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 int v81; // [sp+48020h] [bp-44h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 unsigned int x_; // [sp+48024h] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348 unsigned int teal; // [sp+48028h] [bp-3Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349 int v84; // [sp+4802Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 int v85; // [sp+48030h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 int v86; // [sp+48034h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 int v87; // [sp+48038h] [bp-2Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 int black; // [sp+48040h] [bp-24h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14355 int v90; // [sp+48044h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 unsigned int i; // [sp+48048h] [bp-1Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 unsigned int v92; // [sp+4804Ch] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14358 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 unsigned int v94; // [sp+48054h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 unsigned int v95; // [sp+48058h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 int v96; // [sp+4805Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 const void *v97; // [sp+48060h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 char *a4a; // [sp+4806Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364 int a5a; // [sp+48070h] [bp+Ch]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 x_ = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 y_ = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 v85 = (signed int)(x + a4) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 v90 = (signed int)(y + a5) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370 v79 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 pRenderer->Clip_v2(x, y, a4, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 v5 = viewparams->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 v6 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374 v86 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 v84 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 if ( viewparams->field_2C != 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378 if ( viewparams->field_2C == 768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382 v5 = 680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387 v94 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388 v92 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14389 v93 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14390 v95 = (unsigned int)pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14391 v78 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14392 v87 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14393 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 black = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395 teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397 v96 = 32768 - black - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 v31 = (signed __int64)((double)v96 / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 v32 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 v33 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401 v34 = (int)v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14404 v76 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405 v35 = v34 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14406 if ( v95 && (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 v96 = v92;
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 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 v36 = v95 + v35 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415 i = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416 v88 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 v37 = black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418 v77 = (unsigned __int16 *)v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14421 *(short *)v32 = v78[*((char *)v77 + v37)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 v32 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14423 v97 = (char *)v97 + v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14424 v37 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425 --i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 while ( i );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 v34 += v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430 v97 = (const void *)teal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431 black = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432 v32 += 2 * (v94 - v88);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433 v35 = v34 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 --v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 while ( v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 v97 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14439 if ( (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14441 v96 = v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14442 v38 = 2 * (v79 - v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 v39 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448 v40 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449 v41 = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14450 v42 = v94 & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 v43 = v94 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 memcpy(v93, v97, 4 * (v94 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 v45 = (int)((char *)v40 + 4 * v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454 v44 = (int)&v41[2 * v43];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455 v46 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14456 v39 *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 v93 = (unsigned __int16 *)((char *)v93 + v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 v97 = (char *)v97 + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 while ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14461 *(short *)v44 = *(short *)v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 v45 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463 v44 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 --v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 v93 = (unsigned __int16 *)((char *)v93 + v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 --v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471 while ( v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475 v6 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 v86 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 v84 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14478 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14479 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 v5 = viewparams->field_2C - 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14484 v7 = (uint *)pIndoor->pMapVertices;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14485 uNumBlueFacesInBLVMinimap = 0;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14486 v8 = pIndoor->pMapVertices->uNumVertices == 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14487 v9 = (pIndoor->pMapVertices->uNumVertices & 0x80000000u) != 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489 if ( !(v9 | v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14494 v10 = (int)((char *)v7 + i + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14495 v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 if ( BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14497 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14498 v12 = *(short *)((char *)v7 + i + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14499 if ( !(v12 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14501 if ( !(v96 & 0x80) && (v11 & 0x80u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14502 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14503 v96 = (signed int)v94 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14504 v13 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14505 *(short *)(v10 + 10) = v12 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14506 pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14508 v14 = *(short *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14509 v88 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14510 v15 = &pIndoor->pVertices[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14511 v16 = v15->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14512 v17 = v15->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14513 v93 = (unsigned __int16 *)(v16 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14514 v92 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14515 v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14516 v19 = v18->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14517 v20 = v18->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14518 v95 = v19 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14519 v97 = (const void *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14520 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14521 v87 = (unsigned __int64)((signed int)v92 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14522 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14523 v92 = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14524 pRenderer->FillRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14525 v85 + v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14526 v90 - v87,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14527 v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14528 v90 - v92,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14529 black);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14530 v7 = (uint *)pIndoor->pMapVertices;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532 ++v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14533 i += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14535 while ( (signed int)v94 < (signed int)*v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14537 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 v22 = pBlueFacesInBLVMinimapIDs[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543 v87 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544 v23 = (int)&v7[3 * v22 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545 v24 = &pIndoor->pVertices[*(short *)v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546 v25 = &pIndoor->pVertices[*(short *)(v23 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547 v26 = v25->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 v27 = (unsigned __int16 *)(v24->x - v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 v28 = v24->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 v29 = v25->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 v93 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 v92 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 v97 = (const void *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558 pRenderer->FillRect(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 v85 + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 v90 - v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 v85 + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 v90 - v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 teal);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 break;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14567 v7 = (uint *)pIndoor->pMapVertices;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573 v81 = pParty->vPosition.z - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 v97 = (const void *)((unsigned __int64)((pParty->vPosition.z - v84) * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576 v49 = v90 - (int)v97 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 if ( v47 >= (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 if ( v47 > (signed int)a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 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
14582 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14583 v47 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14586 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14588 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85) < (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14589 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14590 v47 = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592 if ( v49 >= (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 if ( v49 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 if ( v90 - (signed int)v97 - 6 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598 v49 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 if ( v90 - (signed int)v97 < (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 v49 = y_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607 if ( v48 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14609 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14610 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 if ( (signed int)v51 > 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 if ( (signed int)v51 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617 if ( (signed int)v51 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619 if ( (signed int)v51 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 if ( (signed int)v51 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14623 if ( (signed int)v51 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 if ( (signed int)v51 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14626 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14627 v73 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14631 v73 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14634 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14636 v73 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14639 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14641 v73 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14644 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14646 v73 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14649 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14651 v73 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 v50 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14658 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 pRenderer->_4A6776(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 v47,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 v49,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666 v86 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 v94 = (unsigned int)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 if ( *(char *)(v94 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 v53 = *(int *)(v94 + 4) - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 v93 = (unsigned __int16 *)(*(int *)v94 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 v92 = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14679 v55 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 if ( v54 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682 if ( v54 <= pRenderer->field_24_clipz && v55 >= pRenderer->field_20_clipy && v55 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 if ( v5 > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 v96 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 black = v55 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 pRenderer->FillRect(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690 pRenderer->FillRect(v54, black, v54, v96, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 ++v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 v72 = v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694 v71 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14695 v70 = black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14697 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 v72 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 v70 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703 pRenderer->FillRect(v54, v70, v71, v72, v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707 ++v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 result = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 v94 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711 while ( (signed int)v95 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 v90 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 v95 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 v77 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719 black = (1 << (v56 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14720 v57 = (double)(1 << (16 - v56));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721 v58 = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723 v60 = (int)v59 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 v97 = (const void *)((int)v59 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 v61 = (signed __int64)((double)(32768 - v58 - v84) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726 v78 = (unsigned __int16 *)(v60 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727 v62 = (int)v61 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728 teal = v60 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 v63 = (signed __int16)v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 a4a = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733 for ( i = result; v85 < (signed int)v95; result = v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 a5a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14736 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14738 v96 = (v63 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 v64 = teal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14742 v81 = (v64 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14743 if ( !pOutdoor->_47F04C(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 if ( pOutdoor->_47F097(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14747 if ( !((a5a + v85) % 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14748 *(short *)a4a = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14752 *(short *)a4a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 a4a += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 v97 = (char *)v97 + black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757 v64 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14758 ++a5a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14760 while ( a5a < v90 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14762 v62 += black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 v97 = (const void *)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764 a4a += 2 * (v90 - a5a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 v63 = v62 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766 ++v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767 teal = (unsigned int)v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14769 v65 = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14770 v66 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14771 if ( (signed int)v95 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 v67 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14774 result = 2 * (v79 - v90);
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 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14779 v68 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14780 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782 v69 = *(short *)v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 if ( !*(short *)v66 || v69 == (short)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14784 *v67 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14785 v66 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14786 ++v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14787 --v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14789 while ( v68 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14791 v67 = (unsigned __int16 *)((char *)v67 + result);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 --v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 while ( v65 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14799
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14800 //----- (00443219) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14801 int ViewingParams::_443219()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 this->sPartyPosZ += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 //----- (00443225) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808 int ViewingParams::_443225()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14810 this->sPartyPosX -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14811 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14814 //----- (00443231) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14815 int ViewingParams::_443231()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817 this->sPartyPosZ -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14820
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14821 //----- (0044323D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822 int ViewingParams::_44323D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14824 this->sPartyPosX += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14825 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828 //----- (00443249) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14829 int ViewingParams::_443249()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14831 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 if ( v1 < 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 this->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837 this->sPartyPosX = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 this->sPartyPosZ = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 //----- (00443291) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843 int ViewingParams::_443291()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14846 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14848 v1 = 2 * this->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 v2 = 1536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852 v2 = 3072;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 if ( v1 > v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 this->field_2C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855 this->sPartyPosX = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856 this->sPartyPosZ = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14860 //----- (004432E7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14861 int ViewingParams::_4432E7()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14863 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14864 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865 signed int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867 int v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14868 int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14869 int v7; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14870 int result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 v2 = this->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 v3 = 88 >> this->field_2C / 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875 v4 = (44 - v3) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 if ( v1->sPartyPosZ > v2 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14877 v1->sPartyPosZ = v2 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14878 v5 = v1->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14879 v6 = (v3 - 44) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14880 if ( v1->sPartyPosX < v5 + v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14881 v1->sPartyPosX = v5 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 v7 = v2 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 if ( v1->sPartyPosZ < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 v1->sPartyPosZ = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885 result = v5 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886 if ( v1->sPartyPosX > v5 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 v1->sPartyPosX = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 //----- (00443343) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14892 unsigned int ViewingParams::_443343()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14894 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14895 unsigned __int16 *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14896 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14897
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14898 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14899 v2 = this->pPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14902 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14903 *v2 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14904 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14907 while ( v1 < 256 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14908 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 //----- (00443365) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 int ViewingParams::_443365()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915 __int16 *v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 Vec3_short_ *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 unsigned int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 signed int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 Vec3_short_ *v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920 signed int v7; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 signed int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 char v9; // zf@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 int result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 unsigned int v11; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14925 unsigned int *v12; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14926 unsigned int v13; // [sp+Ch] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14927 unsigned int v14; // [sp+10h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 unsigned int v15; // [sp+14h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929 unsigned int v16; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14930 unsigned int v17; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14931
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14932 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 _443343();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14936 v16 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14937 v14 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 v17 = 0xC0000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 v15 = 0xC0000000u;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14940 if ( (signed int)pIndoor->pMapVertices->uNumVertices > 0 )
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14941 {
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14942 v2 = (__int16 *)(pIndoor->pMapVertices->pVertices);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14943 v11 = pIndoor->pMapVertices->uNumVertices;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
14944 v12 = (uint *)pIndoor->pMapVertices->pVertices;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 v3 = &pIndoor->pVertices[*v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948 v4 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949 if ( (signed int)v4 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 v16 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 if ( (signed int)v4 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 v17 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 v5 = v3->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 v13 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 if ( v5 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 v14 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957 if ( v5 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958 v15 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 v6 = &pIndoor->pVertices[v2[1]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 v7 = v6->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 if ( v7 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 v16 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 if ( v7 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964 v17 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 v8 = v6->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966 if ( v8 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 if ( v8 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 v15 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 v2 = (__int16 *)(v12 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 v9 = v11-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 v12 += 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 while ( !v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 v1->uMinimapZoom = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977 v1->field_38 = (signed int)(v16 + v17) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 v1->field_28 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14979 result = (signed int)(v14 + v15) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 v1->field_3A = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14982 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 v1->field_38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14985 v1->field_3A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14986 v1->uMinimapZoom = dword_576E2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14987 result = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988 v1->field_28 = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14990 v1->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14991 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14995 //----- (00443801) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14996 int __cdecl Initialize2DA()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14997 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 const char *v0; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 _2devent *v1; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15000 char *v2; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15001 int v3; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15002 char v4; // cl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004 int v6; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15005 int v7; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 int result; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007 signed int v9; // [sp+10h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 signed int v10; // [sp+14h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010 int it = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15011
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012 if ( p2DEventsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 pAllocator->FreeChunk(p2DEventsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 p2DEventsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 p2DEventsTXT_Raw = (char *)pEvents_LOD->LoadRaw("2dEvents.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15017 strtok(p2DEventsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15018 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15019 v1 = p2DEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15022 v2 = strtok(0, v0) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15023 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15024 v3 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 v9 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 v4 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 while ( v4 != 9 && v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15032 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 v4 = v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035 v6 = (int)&v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036 if ( !v2[v5] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 *(char *)v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15039 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15041 switch ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 if ( _strnicmp(v2, "wea", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 if ( _strnicmp(v2, "arm", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15048 if ( _strnicmp(v2, "mag", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15050 if ( _strnicmp(v2, "alc", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15052 if ( _strnicmp(v2, "sta", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15054 if ( _strnicmp(v2, "boa", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15056 if ( _strnicmp(v2, "tem", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15058 if ( _strnicmp(v2, "tra", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15059 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15060 if ( _strnicmp(v2, "tow", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15062 if ( _strnicmp(v2, "tav", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15064 if ( _strnicmp(v2, "ban", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15066 if ( _strnicmp(v2, "fir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15068 if ( _strnicmp(v2, "air", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15070 if ( _strnicmp(v2, "wat", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15072 if ( _strnicmp(v2, "ear", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15073 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15074 if ( _strnicmp(v2, "spi", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15076 if ( _strnicmp(v2, "min", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15078 if ( _strnicmp(v2, "bod", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15080 if ( _strnicmp(v2, "lig", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15082 if ( _strnicmp(v2, "dar", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15084 if ( _strnicmp(v2, "ele", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15086 if ( _strnicmp(v2, "sel", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15088 if ( _strnicmp(v2, "mir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15090 v7 = -(_strnicmp(v2, "mer", 3u) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15091 LOBYTE(v7) = v7 & 0xEE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15092 v1->uType = v7 + 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15094 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15096 v1->uType = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15099 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15101 v1->uType = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15104 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15106 v1->uType = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15109 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15111 v1->uType = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15112 }
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 v1->uType = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15118 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15119 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15121 v1->uType = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15122 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15124 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15126 v1->uType = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15131 v1->uType = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15134 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15136 v1->uType = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15139 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141 v1->uType = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15144 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 v1->uType = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15149 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15151 v1->uType = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15152 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 v1->uType = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15159 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161 v1->uType = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 v1->uType = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171 v1->uType = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176 v1->uType = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181 v1->uType = 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186 v1->uType = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15189 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15191 v1->uType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15194 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15196 v1->uType = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 v1->uType = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15204 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 v1->uType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 v1->uAnimationID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 v1->pName = (char *)RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216 v1->pProprieterName = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 v1->pProprieterTitle = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 v1->field_14 = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225 v1->_state = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 v1->_rep = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 v1->_per = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 v1->fPriceMultiplier = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 v1->flt_24 = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15240 v1->field_1C = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243 v1->uOpenTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15245 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15246 v1->uCloseTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15247 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15249 v1->uExitPicID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15250 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15251 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15252 v1->uExitMapID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15253 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15254 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15255 v1->_quest_related = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15257 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 v1->pEnterText = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 v2 = (char *)(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 v3 = v9 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15267 result = v3 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 while ( v3 + 1 <= 23 && !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15270 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 //if ( (signed int)v1 >= (signed int)&unk_597F10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 if (++it >= 525)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15277
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15278 //----- (00443CE1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15279 unsigned int __fastcall LoadEventsToBuffer(const char *pContainerName, char *a2, unsigned int uBufferSize)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15281 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15282 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15283 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15284 char Args; // [sp+8h] [bp-B4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15285 //Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286 void *Dst; // [sp+B4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15287 void *ptr; // [sp+B8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15289 v3 = pContainerName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15290 Dst = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 ptr = pEvents_LOD->LoadRaw(pContainerName, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15293 Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15294 //Texture::Texture(&DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15295
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15296 v4 = pEvents_LOD->FindContainer(v3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15297 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15298 Abortf("Unable to load %s", v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15299 fread(&DstBuf, 1u, 0x30u, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15300 v5 = DstBuf.uDecompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 if ( !DstBuf.uDecompressedSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15302 v5 = DstBuf.uTextureSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 memset(&DstBuf, 0, 0x48u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15304 if ( (signed int)v5 >= (signed int)uBufferSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15306 sprintfex(&Args, "File %s Size %lu - Buffer size %lu", v3, v5, uBufferSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15307 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309 memcpy(Dst, ptr, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15310 pAllocator->FreeChunk(ptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15311 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15313
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15314 //----- (00443DA1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15315 void __cdecl Initialize_GlobalEVT()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15317 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15318 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319 char *v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15322 uGlobalEVT_Size = LoadEventsToBuffer("global.evt", pGlobalEVT, 0xB400u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15323 if ( uGlobalEVT_Size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15325 uGlobalEVT_NumEvents = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15326 memset(pGlobalEVT_Events, 128, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15327 v1 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15328 v2 = (char *)&pGlobalEVT_Events[uGlobalEVT_NumEvents].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15329 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15331 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15332 *((int *)v2 - 1) = (unsigned __int8)pGlobalEVT[v0 + 1] + ((unsigned __int8)pGlobalEVT[v0 + 2] << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15333 *(int *)v2 = (unsigned __int8)pGlobalEVT[v0 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15334 *((int *)v2 + 1) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15335 v2 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15336 v0 += (unsigned __int8)pGlobalEVT[v0] + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15338 while ( v0 < (signed int)uGlobalEVT_Size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15339 uGlobalEVT_NumEvents = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15340 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15342
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15343 //----- (00443E31) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15344 void __cdecl LoadLevel_InitializeLevelStr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15346 signed __int16 v0; // si@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15347 //unsigned int v1; // ecx@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15348 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15349 int v3; // edx@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15350 //int v4; // eax@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15351 int v5; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15352 int v6; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15353 int v7; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15354 unsigned int *v8; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15355 char Args[100]; // [sp+Ch] [bp-68h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15356 int v10; // [sp+70h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15357
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15358 if (sizeof(pLevelStrOffsets) != 0x7D0)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15359 Log::Warning(L"pLevelStrOffsets: deserialization warning");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15360 memset(pLevelStrOffsets, 0, 0x7D0u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15361
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15362 v0 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15363 //v1 = uLevelStrFileSize;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15364 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15365 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15366 v10 = 0;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15367 //v4 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15368 for (uint i = 0; i < uLevelStrFileSize; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15369 {
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15370 if ( !pLevelStr[i] )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15372 v5 = (signed __int16)v2++;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15373 pLevelStrOffsets[v5] = i + 1;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15374 if ( (signed __int16)(i - (short)v10) > v0 )
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15375 v0 = i - v10;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15376 v10 = i;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15377 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15378 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15379
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 uLevelStrNumStrings = (signed __int16)v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 if ( v0 > 800 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 sprintfex(Args, "MAX_EVENT_TEXT_LENGTH needs to be increased to %lu", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 Abortf(Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 if ( (signed __int16)v2 - 1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 v8 = &pLevelStrOffsets[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393 if ( RemoveQuotes(&pLevelStr[*v8]) != &pLevelStr[*v8] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15394 ++*v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396 v7 = (signed __int16)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 while ( (signed __int16)v6 < (signed int)uLevelStrNumStrings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 //----- (00443EF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 void __cdecl LoadLevel_InitializeLevelEvt()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15404 {
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15405 if (!uLevelEVT_Size)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15406 return;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15407
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15408 memset(array_5B5928, 0, 0xC80u);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15409 memset(pLevelEVT_Events, 128, 0xCE40u);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15410
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15411 uLevelEVT_NumEvents = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15412 dword_5B65C8 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15413
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15414 for (uint i = 0, j = 0; j < uLevelEVT_Size; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15415 {
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15416 pLevelEVT_Events[i].uEventID = pLevelEVT[j + 1] + ((unsigned short)pLevelEVT[j + 2] << 8);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15417 pLevelEVT_Events[i].field_4 = pLevelEVT[j + 3];
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15418 pLevelEVT_Events[i].uEventOffsetInEVT = j;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15419 j += pLevelEVT[j] + 1;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15420
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15421 uLevelEVT_NumEvents++;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15422 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15423 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15424
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15425 //----- (00443F95) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15426 void __cdecl OnMapLeave()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15428 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15429 char *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15430 int v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15432 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15433 if ( (signed int)uLevelEVT_NumEvents > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15435 v1 = (char *)&pLevelEVT_Events[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15436 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15438 if ( pLevelEVT[*((short *)v1 + 2) + 4] == 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15440 v2 = *((int *)v1 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15441 dword_597F18 = *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15442 EventProcessor(v2, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15443 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15445 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15446 v1 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15448 while ( v0 < (signed int)uLevelEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15450 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15451
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15452
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15453 //----- (00443FDC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15454 void OnMapLoad()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15456 stru176 *v3; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15457 __int16 v4; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15458 __int16 v5; // di@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15459 int v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15460 signed __int64 v8; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15461 unsigned int v9; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15462 signed __int64 v10; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15463 signed __int64 v11; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15464 int v12; // ST50_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15465 signed __int64 v13; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15466 signed __int64 v14; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15467 int v15; // ST58_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15468 signed __int64 v16; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15469 int v17; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15470 unsigned __int64 v18; // [sp+Ch] [bp-44h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15471 signed __int64 v19; // [sp+14h] [bp-3Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15472 unsigned __int64 v20; // [sp+1Ch] [bp-34h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15473 int v22; // [sp+2Ch] [bp-24h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15474 int v24; // [sp+34h] [bp-1Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15475 int v25; // [sp+38h] [bp-18h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15476 int v26; // [sp+3Ch] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15477 int v27; // [sp+3Ch] [bp-14h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15478 int v28; // [sp+40h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15479 __int16 v29; // [sp+46h] [bp-Ah]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15480 __int16 v30; // [sp+48h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15481 __int16 v31; // [sp+4Ah] [bp-6h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15482 __int16 v32; // [sp+4Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15483 __int16 v33; // [sp+4Eh] [bp-2h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15484
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15485 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15486 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15487 auto pEvent = pLevelEVT_Events + i;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15488
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15489 auto _evt = (_evt_raw *)(pLevelEVT + pEvent->uEventOffsetInEVT);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15490
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15491 if (_evt->v4 == 3)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15492 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15493 pSoundList->_4A9A67(
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15494 _evt->v5 +
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15495 ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15496 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15497 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15498 else if (_evt->v4 == 37)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15499 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15500 dword_597F18 = pEvent->field_4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15501 EventProcessor(pEvent->uEventID, 0, 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15502 dword_597F18 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15503 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15504 else if (_evt->v4 == 31 || _evt->v4 == 38)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15505 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15506 v3 = &array_5B5928[dword_5B65C8];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15507 v20 = pOutdoor->uLastVisitDay;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15508 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15509 v20 = pIndoor->stru1.uLastVisitDay;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15510
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15511 v4 = _evt->v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15512 v3->field_1C = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15513 v3->field_8 = pEvent->uEventID;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15514 v3->field_A = pEvent->field_4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15515 v33 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15516 v3->field_12 = v33;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15517 v32 = _evt->v7;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15518 v3->field_14 = v32;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15519 v31 = _evt->v8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15520 v3->field_16 = v31;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15521 v5 = _evt->v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15522 v30 = _evt->v9;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15523 v3->field_18 = v30;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15524 v29 = _evt->v10;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15525 v3->field_1A = v29;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15526
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15527 v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15528 v3->field_10 = v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15529 v3->field_C = v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15530 v3->field_E = v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15531 if ( v4 == 38 && !(short)v6 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15532 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15533 if ( v20 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15534 v18 = pParty->uTimePlayed - v20;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15535 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15536 v18 = 0i64;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15537 v26 = (signed int)(signed __int64)((double)(signed __int64)v18 * 0.234375) / 60 / 60 / 24;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15538
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15539 if ( v26 / 7 / 4 / 12 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15540 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15541 if ( v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15542 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15543 v3->field_4 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15544 ++dword_5B65C8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15545 v3->field_0 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15546 continue;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15547 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15548 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15549 if (v26 / 7 / 4 != 0 && v33 != 0 ||
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15550 v26 / 7 != 0 && v32 != 0 ||
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15551 v26 != 0 || !v20)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15552 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15553 v3->field_4 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15554 ++dword_5B65C8;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15555 v3->field_0 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15556 continue;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15557 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15558 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15559
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15560 v8 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15561 v9 = v8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15562 v10 = (signed int)v8 / 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15563 v22 = v10 % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15564 v11 = (signed int)(v10 / 60);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15565 v12 = v11 % 24;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15566 v13 = (signed int)(v11 / 24);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15567 v27 = v13 % 7;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15568 v14 = (signed int)(v13 / 7);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15569 v15 = v14 % 4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15570 v16 = (signed int)(v14 / 4);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15571 v24 = v16 / 12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15572
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15573 auto _1 = (unsigned __int64)((double)pParty->uTimePlayed * 0.234375) >> 32;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15574 auto _2 = ((__int64)v9 << 32) | _1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15575
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15576 v19 = _2 % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15577 //v19 = (signed __int64)__PAIR__((unsigned __int64)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) >> 32,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15578 // v9)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15579 // % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15580
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15581 v17 = v12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15582 v25 = v15;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15583 v28 = v16 % 12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15584 if ( v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15585 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15586 ++v24;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15587 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15588 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15589 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15590 if ( v33 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15591 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15592 ++v28;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15596 if ( v32 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15597 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15598 ++v25;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15599 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15600 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15601 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15602 ++v27;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15603 v22 = v30;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15604 v17 = v31;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15605 v19 = v29;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15606 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15607 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15608 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15609 auto v0 = (signed __int64)((double)((v19
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15610 + 0x3C * v22
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15611 + 0xE10 * v17
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15612 + 0x93A80 * v25
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15613 + 0x15180 * v27
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15614 + 0x24EA00 * (v28 + 12i64 * v24)) << 7)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15615 * 0.033333335);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15616 v3->field_4 = HIDWORD(v0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15617
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15618 ++dword_5B65C8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15619 v3->field_0 = v0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15620 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15621 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15622 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15624 //----- (00444360) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 void __thiscall Level_LoadEvtAndStr(const char *pLevelName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627 char pContainerName[120]; // [sp+8h] [bp-98h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15629 sprintf(pContainerName, "%s.evt", pLevelName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630 uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT, 0x2400u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15631
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15632 sprintf(pContainerName, "%s.str", pLevelName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr, 0x2400u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15634 if (uLevelStrFileSize)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 LoadLevel_InitializeLevelStr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638 //----- (004443D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639 char *__cdecl _4443D5_GetMinimapRightClickText()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 int v0; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15642 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 double v3; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 int v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 int v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649 BSPModel *v8; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 unsigned __int8 v9; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15651 char v10; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 unsigned __int8 v11; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15653 ODMFace *v12; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 __int16 v13; // cx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 const char *v14; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 const char *v15; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15657 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658 unsigned int v17; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659 unsigned int v18; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660 int v19; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661 int v20; // [sp+14h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 char *v21; // [sp+18h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15663 unsigned int pY; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664 int v23; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 int v24; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 int pX; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 v24 = pParty->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 v0 = pParty->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 v1 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 v18 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 v3 = 1.0 / *(float *)&v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 v23 = pX - 557;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 v19 = (signed __int64)((double)(pX - 557) * v3 + (double)v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 v20 = (signed __int64)((double)v0 - (double)(signed int)(pY - 74) * v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || (*(float *)&v23 = 0.0, (signed int)v1 <= 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 v17 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 if ( v17 == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 result = "No Maze Info for this maze on file!";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 result = pMapStats->pInfos[v17].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 pX = pOutdoor->pBModels[v4].vBoundingCenter.x - v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 pY = pOutdoor->pBModels[v4].vBoundingCenter.y - v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 v7 = sub_4621DA(v6, v5, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700 if ( v7 < 2 * pOutdoor->pBModels[v4].sBoundingRadius )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 v11 = __OFSUB__(pOutdoor->pBModels[v4].uNumFaces, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703 v9 = pOutdoor->pBModels[v4].uNumFaces == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 v10 = ((pOutdoor->pBModels[v4].uNumFaces - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15708 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 v12 = &v8[v4].pFaces[v2 / 0x134u];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 v13 = v12->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 if ( !(BYTE2(v12->uFaceAttributes) & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 v14 = _444732_GetEventHintString(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720 if ( _strcmpi(v14, nullstring) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 v21 = (char *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727 v2 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 while ( v24 < (signed int)pOutdoor->pBModels[v4].uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 result = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 if ( v23 >= (signed int)v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 //----- (00444564) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 const char *__cdecl sub_444564()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 double v0; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 int v1; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 int v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15752 int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753 int v5; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756 BSPModel *v8; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 unsigned __int8 v9; // zf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15758 unsigned __int8 v10; // sf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 ODMFace *v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 __int16 v12; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 const char *v13; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 const char *v14; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763 const char *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 unsigned int v16; // [sp+0h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 const char *v17; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766 unsigned int pY; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 float v19; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 int v20; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769 int v21; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770 unsigned int v22; // [sp+18h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771 int pX; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773 v20 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774 v21 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775 v19 = (double)viewparams->field_2C * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776 if ( viewparams->field_2C == 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 v20 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 v21 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 v16 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784 v0 = 1.0 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785 v1 = (signed __int64)((double)(pX - 229) * v0 + (double)v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786 LODWORD(v19) = (signed __int64)((double)v21 - (double)(signed int)(pY - 181) * v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787 v2 = abs(v1 + 22528) / 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788 v3 = abs((signed)LODWORD(v19) - 22528);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789 if ( pOutdoor->_47F04C(v2, v3 / 512)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 && uCurrentlyLoadedLevelType == LEVEL_Outdoor
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 && (v4 = 0, v20 = 0, (signed int)v16 > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 pX = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.x + v4) - v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 pY = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.y + v4) - LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799 v7 = sub_4621DA(v6, v5, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801 if ( v7 < *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 v9 = *(unsigned int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804 v10 = *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806 if ( !(v10 | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 v11 = &(*(ODMFace **)((char *)&v8->pFaces + v4))[v22 / 0x134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 v12 = v11->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815 if ( !(BYTE2(v11->uFaceAttributes) & 0x10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 v13 = _444732_GetEventHintString(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 if ( _strcmpi(v13, nullstring) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 v17 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828 v22 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830 while ( v21 < *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832 result = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15833 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837 v4 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15838 if ( v20 >= (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15841 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15842 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15844 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15850
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 //----- (00444A51) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 char *__cdecl TransitionUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 MapInfo *v0; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15857 char *v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15859 std::string v3; // [sp-18h] [bp-84h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 unsigned int v4; // [sp-10h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 int v5; // [sp-Ch] [bp-78h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862 const char *v6; // [sp-8h] [bp-74h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 signed int v7; // [sp-4h] [bp-70h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 GUIWindow v8; // [sp+Ch] [bp-60h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 unsigned int v9; // [sp+60h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866 unsigned int v10; // [sp+64h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15867 int a3; // [sp+6Bh] [bp-1h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15869 memcpy(&v8, pGUIWindow0, sizeof(v8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 uTextureID_507B04 = uTextureID_right_panel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15882 (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884 0x22Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 0x1DCu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891 if ( (pVideoPlayer->AnyMovieLoaded() || v9) && *dword_591164_teleport_map_name != 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 v10 = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 v0 = &pMapStats->pInfos[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894 v8.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 v8.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 v8.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 v8.DrawText2(pFontCreate, 0, 5u, 0, v0->pName, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 v8.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15899 v8.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 v8.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 if ( uCurrentHouse_Animation )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903 v1 = (&off_4EB080)[4 * uCurrentHouse_Animation];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[409], v0->pName);// "Do you wish to leave %s?"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 v1 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 v1 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15917 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
15918 v1 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15920 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921 v7 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15922 v6 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15923 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 v4 = (212 - pFontCreate->CalcTextHeight(v1, &v8, 0, 0)) / 2 + 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925 result = v8.DrawText2(pFontCreate, 0, v4, v5, v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 //----- (00444C8F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15932 GUIWindow *__cdecl UI_CreateTravelDialogue()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934 signed int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 unsigned int v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 GUIWindow *result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15937 const char *v3; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 char pContainer[32]; // [sp+0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15940 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941 v0 = const_2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15942 sprintfex(pContainer, "evt%02d", v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 if ( pParty->uAlignment )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 if ( pParty->uAlignment != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15947 v3 = "-c";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 v3 = "-b";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15953 strcat(pContainer, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 pTexture_outside = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("outside", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957 v1 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15958 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15959 sprintfex(byte_591098, pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 strcpy(byte_591098, pGlobalTXT_LocalizationStrings[79]);// "Exit"
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15962 result = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)17, 0, (int)byte_591098);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15963 pDialogueWindow = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 //----- (00444D80) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 signed int __cdecl GetTravelTime()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 v0 = uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 if ( CheckHiredNPCSpeciality(5u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 if ( CheckHiredNPCSpeciality(6u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976 v0 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 if ( CheckHiredNPCSpeciality(7u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978 v0 -= 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15979 if ( CheckHiredNPCSpeciality(0x2Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15980 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15981 if ( v0 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15982 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 return v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 // 6BD07C: using guessed type int uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 //----- (00444DCA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988 void __cdecl TravelUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 unsigned int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 MapInfo *v1; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 char *v2; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 const char *v5; // [sp-Ch] [bp-90h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 signed int v6; // [sp-8h] [bp-8Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 GUIWindow v7; // [sp+Ch] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999 unsigned int v9; // [sp+80h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 memcpy(&v7, pGUIWindow0, sizeof(v7));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002 v9 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.z, pDestinationMapName, 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 v0 = pMapStats->GetMapInfo(pDestinationMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 pRenderer->DrawTextureTransparent(0x1D4u, 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009 pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 if ( v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 v1 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 v7.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 v7.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 v2 = v1->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 v7.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 v7.DrawText2(pFontCreate, 0, 4u, 0, v2, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 v7.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16022 v7.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16023 v7.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16024 v3 = GetTravelTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16025 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16027 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16028 v5 = pGlobalTXT_LocalizationStrings[663]; // "It will take %d day to cross to %s."
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 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16033 v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16035 sprintfex(pTmpBuf, v5, v6, v1->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16036 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16037 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16038 strcat(pTmpBuf, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16039 v4 = pFontCreate->CalcTextHeight(pTmpBuf, &v7, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16040 v7.DrawText2(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16041 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16044
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16046 //----- (00444FBE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16047 void __cdecl DrawBranchlessDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16049 GUIFont *v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16050 int v1; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16051 char *v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16052 int v3; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16053 char Str[200]; // [sp+Ch] [bp-120h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16054 GUIWindow v5; // [sp+D4h] [bp-58h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16055 GUIFont *pFont; // [sp+128h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16056
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16057 v0 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16058 pFont = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16059 if ( ptr_F8B1E8 && !byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16060 strcpy(byte_5B0938, ptr_F8B1E8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16061 v5.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16062 v5.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16063 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16064 if ( 352 - v1 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16066 pFont = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16067 v1 = pFontCreate->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16069 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16070 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16071 352 - v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16072 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16073 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16074 pRenderer->DrawTextureIndexed(8u, 347 - v1, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16075 v2 = FitTextInAWindow(byte_5B0938, pFont, &v5, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16076 pGUIWindow2->DrawText(pFont, 12, 354 - v1, 0, v2, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16077 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16078 if ( pGUIWindow2->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16080 if ( pGUIWindow2->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16082 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16083 strcpy(GameUI_StatusBar_TimedString, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16084 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16085 sub_4452BB();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16086 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16088 if ( pGUIWindow2->field_40 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16089 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16090 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16091 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16092 memset(GameUI_StatusBar_TimedString, 0, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16093 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16095 if ( pGUIWindow2->ptr_1C == (void *)26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16097 sprintfex(Str, "%s %s", GameUI_StatusBar_TimedString, pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16098 v3 = pFontLucida->GetLineWidth(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16099 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16100 pGUIWindow2->DrawFlashingInputCursor(v3 + 13, 357, pFontLucida);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16101 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16103 if ( pKeyActionMap->pPressedKeysBuffer[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16105 pKeyActionMap->_459ED1(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16106 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16110 //----- (004451A8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16111 void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16113 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16114 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16115
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16116 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16117 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16118 if ( !pGUIWindow2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16120 if ( pParty->uFlags & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16121 pGame->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16122 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16123 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16124 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16125 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16126 dword_5C3418 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16127 dword_5C341C = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16128 _591094_decoration = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16129 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)19, a4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16130 pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16131 pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16132 pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16133 pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, nullstring, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16137 //----- (004452BB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16138 void __cdecl sub_4452BB()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16140 pGUIWindow2->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16141 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16142 _5C3420_pDecoration = _591094_decoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16143 dword_597F18 = dword_5C341C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16144 EventProcessor(dword_5C3418, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16145 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16146 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16147 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16151 //----- (00445308) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16152 const char *__fastcall sub_445308(int a1)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16153 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16154 if ( a1 == 10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16155 || a1 == 11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16156 || a1 == 12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16157 || a1 == 33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16158 || a1 == 34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16159 || a1 == 39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16160 || a1 == 40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16161 || a1 == 41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16162 || a1 == 42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16163 || a1 == 43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16164 || a1 == 52 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16165 return (const char *)*(&pNPCStats->field_13A60 + 5 * a1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16166 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16167 return pNPCTopics[407].pTopic;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16168 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16169
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16171 //----- (00445350) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16172 void __cdecl DrawDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16174 NPCData *v0; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16175 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16176 unsigned __int16 v2; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16177 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16178 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16179 int v5; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16180 char *v6; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16181 char *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16182 unsigned int v8; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16183 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16184 char *v10; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16185 int v11; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16186 int v12; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16187 char *v13; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16188 GUIButton *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16189 GUIButton *v15; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16190 signed int v16; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16191 int v17; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16192 int v18; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16193 int v19; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16194 int v20; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16195 int v21; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16196 int v22; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16197 unsigned int v23; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16198 const char *v24; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16199 int v25; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16200 int v26; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16201 int v27; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16202 int v28; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16203 int v29; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16204 unsigned __int16 v30; // cx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16205 int v31; // ecx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16206 int v32; // ebx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16207 unsigned int v33; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16208 GUIWindow *v34; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16209 int v35; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16210 int i; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16211 GUIButton *v37; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16212 int v38; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16213 signed int v39; // esi@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16214 signed int v40; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16215 unsigned int v41; // ebx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16216 int v42; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16217 GUIButton *v43; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16218 int v44; // eax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16219 unsigned int v45; // ecx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16220 unsigned __int16 *v46; // edx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16221 unsigned __int16 v47; // ax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16222 char pFont; // [sp+4h] [bp-110h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16223 int v49; // [sp+Ch] [bp-108h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16224 int v50; // [sp+14h] [bp-100h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16225 GUIWindow v51; // [sp+58h] [bp-BCh]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16226 GUIWindow v52; // [sp+ACh] [bp-68h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16227 char *Str; // [sp+100h] [bp-14h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16228 __int16 v54[2]; // [sp+104h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16229 unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16230 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16231 char *pInString; // [sp+110h] [bp-4h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16233 if ( !pDialogueWindow )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16234 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16235 memcpy(&v51, pDialogueWindow, sizeof(v51));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16236 v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16237 v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16238 v51.uFrameWidth -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16239 v51.uFrameZ -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16240 *(int *)v54 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16241 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16242 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16243 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16244 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16245 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16246 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16247 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16248 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16249 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16250 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16251 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16252 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16253 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16254 v3 = v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16255 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16257 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16258 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v0->pName, aNPCProfessionNames[v3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16260 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16262 strcpy(pTmpBuf, v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16263 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16265 v51.DrawText2(pFontArrus, 0x1E3u, 0x70u, v2, v4, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16266 pParty->GetPartyFame();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16267 if ( (signed int)uDialogueType > 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16268 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16269 if ( uDialogueType == 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16271 v7 = pGlobalTXT_LocalizationStrings[577]; // "Get back in there you wimps:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16272 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16274 if ( uDialogueType == 91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16275 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16276 sprintfex(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16277 pInString = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16278 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16279 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16281 if ( uDialogueType == 92 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16283 v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16284 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16287 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16289 if ( uDialogueType == 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16291 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
16292 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16294 if ( uDialogueType == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16296 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16297 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16299 if ( (signed int)uDialogueType > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16301 if ( (signed int)uDialogueType > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16303 if ( uDialogueType == 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16305 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16306 if ( byte_F8B1EC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16308 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16309 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16311 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16313 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16314 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16315 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16316 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16317 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16318 pInString = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16319 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16321 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16322 v6 = (char *)*(&pNPCStats->field_13A64 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16323 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16325 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16327 if ( byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16328 goto LABEL_24;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16329 v7 = (char *)ptr_F8B1E8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16330 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16331 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16332 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16335 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16336 if ( *(int *)v54 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16338 v11 = v0->greet;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16339 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16340 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16342 v10 = (char *)*(&pNPCStats->field_17884 + ((v0->uFlags & 3) == 2) + 2 * v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16343 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16346 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16348 if ( *(int *)v54 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16350 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16351 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16352 v9 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16353 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16354 v9 = (char *)*(&pNPCStats->field_13A64 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16355 v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16356 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16357 pInString = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16358 if ( v10 == (char *)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16359 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16360 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16361 v49 = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16362 v50 = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16363 pOutString = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16364 v12 = pFontArrus->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16365 if ( 352 - v12 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16367 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16368 v12 = pFontCreate->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16370 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16371 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16372 352 - v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16373 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16374 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16375 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16376 v13 = FitTextInAWindow(pInString, pOutString, (GUIWindow *)&pFont, 0xDu, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16377 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16378 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16381 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16382 memcpy(&v52, pDialogueWindow, sizeof(v52));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16383 v52.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16384 v52.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16385 v52.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16386 for ( pOutString = (GUIFont *)v52.field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16387 (signed int)pOutString < v52.field_38 + v52.field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16388 pOutString = (GUIFont *)((char *)pOutString + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16390 v14 = v52.GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16391 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16392 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16393 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16394 v16 = v14->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16395 if ( v16 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16397 v25 = v16 - 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16398 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16400 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16401 if ( v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16403 v27 = v26 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16404 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16406 v28 = v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16407 if ( v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16409 v29 = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16410 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16412 if ( v29 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16413 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16414 v24 = pGlobalTXT_LocalizationStrings[581];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16416 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16418 v24 = pGlobalTXT_LocalizationStrings[580];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16421 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16423 v24 = pGlobalTXT_LocalizationStrings[579];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16426 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16428 v24 = pGlobalTXT_LocalizationStrings[578];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16430 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16431 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16433 v24 = pGlobalTXT_LocalizationStrings[407];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16436 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16438 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16440 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16441 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[408], v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16442 v24 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16443 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16445 v24 = pGlobalTXT_LocalizationStrings[406];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16448 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16450 if ( v16 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16451 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16452 v23 = v0->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16453 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16454 v24 = (&dword_721660)[8 * v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16455 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16457 v24 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16458 v15->uControlParam = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16460 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16462 v17 = v16 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16463 if ( !v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16465 v24 = (const char *)sub_445308(v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16466 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16468 v18 = v17 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16469 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16471 v19 = v18 - 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16472 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16474 v23 = v0->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16475 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16477 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16478 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16480 v23 = v0->evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16481 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16483 v21 = v20 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16484 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16486 v23 = v0->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16487 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16489 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16490 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16492 v23 = v0->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16493 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16495 if ( v22 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16497 v23 = v0->evte;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16498 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16500 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16501 v24 = nullstring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16502 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16504 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16505 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16506 v24 = pGlobalTXT_LocalizationStrings[122];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16508 LABEL_79:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16509 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16511 pInString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16512 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16514 v55 = &pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16515 *(int *)v54 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16516 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16518 v30 = *v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16519 if ( *v55 == 5 || v30 == 11 || v30 == 19 || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16520 ++pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16521 v55 += 418;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16522 --*(int *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16524 while ( *(int *)v54 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16526 if ( pInString == (char *)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16527 v24 = pGlobalTXT_LocalizationStrings[658];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16529 strcpy(v15->pButtonName, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16531 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16532 pInString = (char *)GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16533 v33 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16534 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16535 *(int *)v54 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16536 v35 = pDialogueWindow->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16537 for ( i = v35 + pDialogueWindow->field_28; v35 < i; i = pDialogueWindow->field_28 + pDialogueWindow->field_38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16539 v37 = v34->GetControl(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16540 if ( !v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16542 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16543 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16545 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16546 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16547 v32 += v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16548 ++v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16550 v39 = v34->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16551 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16553 pOutString = (GUIFont *)((174 - v32) / v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16554 if ( (174 - v32) / v39 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16555 pOutString = (GUIFont *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16556 v55 = (unsigned __int16 *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16557 v40 = 174 - (int)pOutString * v39 - v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16558 v41 = v34->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16559 v42 = v40 / 2 - (signed int)pOutString / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16560 if ( (signed int)v41 < (signed int)(v41 + v39) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16562 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16564 v43 = v34->GetControl(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16565 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16566 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16567 v43->uY = (unsigned int)((char *)pOutString + v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16568 Str = v43->pButtonName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16569 v44 = pFontArrus->CalcTextHeight(v43->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16570 v45 = v43->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16571 v46 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16572 v43->uHeight = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16573 v42 = v45 + v44 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16574 v43->uW = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16575 v47 = v54[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16576 if ( (unsigned __int16 *)pDialogueWindow->field_2C_focus_id != v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16577 v47 = (unsigned __int16)pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16578 v52.DrawText2(pFontArrus, 0, v45, v47, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16579 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16580 v55 = (unsigned __int16 *)((char *)v55 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16581 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16582 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16583 while ( (signed int)v41 < pDialogueWindow->field_28 + pDialogueWindow->field_38 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16586 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16587 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16588 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16589 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16591
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16592 //----- (004459F9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16593 NPCData *__fastcall GetNPCData(unsigned int npcid)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16595 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16596 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16597 int v3; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16598 int v4; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16599 int v5; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16600 NPCData *v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16601 char *v7; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16602 NPCData *v8; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16603 char v9; // al@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16604 std::string v10; // [sp-18h] [bp-2Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16605 const char *v11; // [sp-8h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16606 int v12; // [sp-4h] [bp-18h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16607 std::string *v13; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16608 int a3; // [sp+13h] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16609
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16610 v1 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16611 if ( (npcid & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16613 if ( (signed int)npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16615 if ( (signed int)npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16617 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
16618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16619 return &pNPCStats->pNewNPCData[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16621 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16622 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16623 if ( (signed int)npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16624 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16625 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16627 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16629 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16631 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16632 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16633 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16634 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16635 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16637 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16638 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16639 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16640 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16642 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16643 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16644 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16646 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16647 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16648 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16650 if ( v8->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16651 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16652 && (!pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16653 *v7++ = (char)v13 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16654 v13 = (std::string *)((char *)v13 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16655 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16657 while ( (signed int)v13 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16659 v9 = pTmpBuf[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16660 if ( (unsigned __int8)v9 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16661 result = &pNPCStats->pNPCData[(unsigned __int8)v9 + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16662 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16663 result = &pParty->pHirelings[(unsigned __int8)v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16665 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16667
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16668 //----- (00445B2C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16669 NPCData *__fastcall GetNewNPCData(signed int npcid, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16671 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16672 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16673 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16674 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16675 int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16676 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16677 NPCData *v8; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16678 NPCData *v9; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16679 int v10; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16680 char v11; // al@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16681 std::string v12; // [sp-18h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16682 const char *v13; // [sp-8h] [bp-24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16683 int v14; // [sp-4h] [bp-20h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16684 std::string *v15; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16685 char *v16; // [sp+10h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16686 int v17; // [sp+14h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16687 int a3; // [sp+1Bh] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16688
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16689 v2 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16690 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16691 v15 = (std::string *)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16692 if ( npcid >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16694 if ( npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16696 if ( npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16698 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
16699 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16700 *(int *)v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16701 return &pNPCStats->pNewNPCData[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16703 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16704 *(int *)a2 = npcid - 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16705 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16707 if ( npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16708 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16709 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16711 *(int *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16712 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16714 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16716 v5 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16717 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16718 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16719 v8 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16720 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16722 if ( v8->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16723 pTmpBuf[v6++] = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16724 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16725 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16727 while ( (signed int)v8 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16728 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16729 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16731 v9 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16732 v16 = &pTmpBuf[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16733 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16735 if ( v9->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16736 && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16737 && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16739 v10 = (int)v16++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16740 *(char *)v10 = v17 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16742 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16743 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16745 while ( v17 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16746 v3 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16748 v11 = pTmpBuf[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16749 if ( (unsigned __int8)v11 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16751 *(int *)v3 = (unsigned __int8)v11 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16752 result = &pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[v5] + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16754 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16756 *(int *)v3 = (unsigned __int8)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16757 result = &pParty->pHirelings[(unsigned __int8)pTmpBuf[v5]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16758 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16760 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16762
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16763 //----- (00445C8B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16764 int __fastcall sub_445C8B(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16766 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16767 int v3; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16768 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16769 int v5; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16770 NPCData *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16771 char *v7; // ebp@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16772 NPCData *v8; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16774 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16775 if ( a1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16777 if ( a1 < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16778 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16779 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16781 if ( a1 >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16782 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16783 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16784 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16785 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16786 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16787 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16789 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16790 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16791 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16792 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16794 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16795 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16797 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16798 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16799 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16801 if ( v8->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16802 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16803 if ( !pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16804 *v7++ = v1 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16806 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16807 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16809 while ( v1 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16811 return ((unsigned __int8)pTmpBuf[v3] < 2u) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16813
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16814
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16815 //----- (0044603D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16816 void __cdecl sub_44603D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16818 uDialogue_SpeakingActorNPC_ID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16819 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16820 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16821 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16822 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16824
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16825
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16826 //----- (004465DF) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16827 int sub_4465DF_check_season(int a1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16829 unsigned int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16830 unsigned int v2; // edx@1
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16831 int v3; // ecx@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16832 int v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16833 char v6; // zf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16835 v1 = pParty->uCurrentMonth + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16836 v2 = pParty->uDaysPlayed + 1;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16837 if ( a1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16838 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16839 v3 = a1 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16840 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16841 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16842 v4 = v3 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16843 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16845 if ( v4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16846 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16847 if ( v1 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16849 if ( (signed int)v1 >= 1 && (signed int)v1 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16850 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16851 v6 = v1 == 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16852 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16853 if ( !v6 || (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16854 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16855 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16858 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16860 if ( v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16862 if ( (signed int)v1 >= 10 && (signed int)v1 <= 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16863 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16864 v6 = v1 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16865 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16867 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16869 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16871 if ( v1 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16873 if ( (signed int)v1 >= 7 && (signed int)v1 <= 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16874 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16875 v6 = v1 == 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16876 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16878 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16880 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16882 if ( v1 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16884 if ( (signed int)v1 >= 4 && (signed int)v1 <= 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16885 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16886 v6 = v1 == 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16887 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16890 if ( (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16891 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16892 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16893 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16894
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16895 //----- (0044665D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16896 // uType: 0 -> any monster
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16897 // 1 -> uParam is GroupID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16898 // 2 -> uParam is MonsterID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16899 // 3 -> uParam is ActorID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16900 // uNumAlive: 0 -> all must be alive
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16901 int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16903 unsigned int uAliveActors; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16904 int v5; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16905 unsigned int uTotalActors; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16906
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16907 uTotalActors = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16908 if ( uType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16910 if ( uType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16912 uAliveActors = SearchActorByGroup(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16914 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16916 if ( uType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16918 uAliveActors = SearchActorByMonsterID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16920 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16922 if ( uType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16923 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16924 uAliveActors = SearchActorByID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16928 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16930 uAliveActors = SearchAliveActors(&uTotalActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16932 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16933 if ( uNumAlive )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16934 LOBYTE(v5) = (signed int)uAliveActors >= (signed int)uNumAlive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16935 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16936 LOBYTE(v5) = uTotalActors == uAliveActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16937 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16939
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16940 //----- (004466C4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16941 bool __thiscall sub_4466C4(void *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16942 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16943 signed int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16944 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16945 int v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16946 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16947 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16948 unsigned int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16949 char *v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16950 signed int v8; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16951 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16952 Player *v10; // [sp+8h] [bp-10h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16953 signed int v11; // [sp+Ch] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16954 signed int v12; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16955 void *v13; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16956
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16957 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16958 v13 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16959 if ( !_this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16960 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16961 v3 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16962 pSomeOtherEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16963 uSomeOtherEVT_NumEvents = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16964 memcpy(pSomeOtherEVT_Events, pGlobalEVT_Events, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16965 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16966 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16967 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16968 if ( (signed int)uSomeOtherEVT_NumEvents <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16969 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16970 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16972 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16973 if ( (void *)pSomeOtherEVT_Events[v1].uEventID == v13 && pSomeOtherEVT_Events[v5].field_4 == v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16975 v6 = pSomeOtherEVT_Events[v5].uEventOffsetInEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16976 v7 = &pSomeOtherEVT[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16977 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16978 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16979 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16981 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16982 v10 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16983 v8 = (unsigned __int8)v7[7]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16984 + (((unsigned __int8)v7[8] + (((unsigned __int8)v7[9] + ((unsigned __int8)v7[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16985 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16987 LOBYTE(v9) = v10->CompareVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16988 (enum VariableType)((unsigned __int8)pSomeOtherEVT[v6 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16989 + ((unsigned __int8)pSomeOtherEVT[v6 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16990 v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16991 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16992 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16993 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16994 if ( (signed int)v10 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16995 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16998 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17000 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17001 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17002 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17004 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17005 v12 = (unsigned __int8)v7[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17006 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17008 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] != 52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17009 || !IsActorAlive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17010 (unsigned __int8)v7[5],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17011 (unsigned __int8)v7[6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17012 + (((unsigned __int8)v7[7] + (((unsigned __int8)v7[8] + ((unsigned __int8)v7[9] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17013 (unsigned __int8)v7[10]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17014 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17016 v1 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17017 v3 = (unsigned __int8)pSomeOtherEVT[v6 + 11] - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17018 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17019 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17020 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17022 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17024 while ( v1 < (signed int)uSomeOtherEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17025 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17026 result = v12 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17027 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17028 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17029 result = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17030 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17033
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17034 //----- (0044684A) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17035 void __fastcall EventProcessor(int uEventID, int a2, int a3)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17037 unsigned int v3; // eax@5
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17038 //signed int v4; // esi@7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17039 //char *v5; // eax@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17040 Player *v6; // ecx@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17041 //char *v7; // ebp@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17042 //signed int v8; // edx@10
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17043 //int v9; // edi@12
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17044 //ByteArray *v10; // esi@12
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17045 int v11; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17046 char *v12; // eax@15
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17047 //char *v13; // edi@21
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17048 int v14; // ebp@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17049 int v15; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17050 const char *v16; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17051 bool v17; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17052 int v18; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17053 int v19; // ebp@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17054 signed int v20; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17055 int v21; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17056 int v22; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17057 int v23; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17058 unsigned __int16 v24; // ax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17059 int v25; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17060 LevelDecoration *v26; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17061 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17062 int v28; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17063 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17064 int v30; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17065 int v31; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17066 int v32; // esi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17067 NPCData *v33; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17068 int v34; // esi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17069 int v35; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17070 int v36; // esi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17071 int v37; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17072 int v38; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17073 int v39; // ecx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17074 size_t v40; // edx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17075 char *v41; // esi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17076 int v42; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17077 int v43; // ecx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17078 size_t v44; // edx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17079 char *v45; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17080 void *v46; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17081 GUIWindow *v47; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17082 GUIButton *v48; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17083 GUIButton *v49; // esi@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17084 char v50; // al@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17085 Player *v51; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17086 Player *v52; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17087 int v53; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17088 char v54; // al@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17089 Player *v55; // esi@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17090 Player *v56; // ecx@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17091 int v57; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17092 signed int v58; // ebp@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17093 Player *v59; // esi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17094 int v60; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17095 int v61; // edx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17096 int v62; // eax@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17097 void *v63; // ebp@145
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17098 signed int v64; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17099 unsigned int v65; // edx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17100 Player *v66; // ecx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17101 int v67; // esi@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17102 signed int v68; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17103 int v69; // esi@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17104 Player *v70; // ecx@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17105 unsigned int v71; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17106 int v72; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17107 signed int v73; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17108 int v74; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17109 int v75; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17110 Player *v76; // esi@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17111 signed int v77; // ebp@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17112 int v78; // edx@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17113 Player *v79; // esi@187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17114 signed int v80; // ebp@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17115 int v81; // edx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17116 Player *v82; // esi@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17117 int v83; // eax@212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17118 int v84; // ebp@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17119 signed int v85; // ebp@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17120 char v86; // al@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17121 Player *v87; // esi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17122 Player *v88; // ecx@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17123 int v89; // ecx@232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17124 int v90; // eax@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17125 const char *v91; // ecx@247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17126 int v92; // eax@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17127 char *v93; // eax@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17128 int v94; // ecx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17129 int v95; // ebp@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17130 int v96; // edx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17131 int v97; // eax@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17132 unsigned int v98; // edx@265
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17133 const char *v99; // esi@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17134 int v100; // edx@267
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17135 //char *v101; // edi@281
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17136 unsigned int v102; // esi@281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17137 int v103; // edi@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17138 int v104; // eax@288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17139 int v105; // edx@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17140 int v106; // [sp-20h] [bp-4C8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17141 signed int v107; // [sp-1Ch] [bp-4C4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17142 unsigned int v108; // [sp-18h] [bp-4C0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17143 signed int v109; // [sp-14h] [bp-4BCh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17144 signed int v110; // [sp-10h] [bp-4B8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17145 int v111; // [sp-Ch] [bp-4B4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17146 Event *v112; // [sp-8h] [bp-4B0h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17147 int v113; // [sp-8h] [bp-4B0h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17148 int v114; // [sp-8h] [bp-4B0h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17149 signed int v115; // [sp-8h] [bp-4B0h]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17150 unsigned int v116; // [sp-8h] [bp-4B0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17151 int v117; // [sp-4h] [bp-4ACh]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17152 int v118; // [sp-4h] [bp-4ACh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17153 int v119; // [sp-4h] [bp-4ACh]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17154 int v120; // [sp-4h] [bp-4ACh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17155 int v121; // [sp-4h] [bp-4ACh]@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17156 int v122; // [sp+10h] [bp-498h]@4
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17157 //char *v123; // [sp+14h] [bp-494h]@0
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17158 //signed int v124; // [sp+18h] [bp-490h]@7
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17159 signed int v125; // [sp+1Ch] [bp-48Ch]@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17160 int v126; // [sp+1Ch] [bp-48Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17161 int v127; // [sp+20h] [bp-488h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17162 int v128; // [sp+24h] [bp-484h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17163 int v129; // [sp+24h] [bp-484h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17164 signed int v130; // [sp+28h] [bp-480h]@0
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17165 //int v131; // [sp+2Ch] [bp-47Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17166 int v132; // [sp+30h] [bp-478h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17167 signed int v133; // [sp+34h] [bp-474h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17168 int v134; // [sp+38h] [bp-470h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17169 int v135; // [sp+3Ch] [bp-46Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17170 int v136; // [sp+40h] [bp-468h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17171 int v137; // [sp+44h] [bp-464h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17172 int v138; // [sp+48h] [bp-460h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17173 int v139; // [sp+4Ch] [bp-45Ch]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17174 ItemGen item; // [sp+50h] [bp-458h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17175 char Source[120]; // [sp+74h] [bp-434h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17176 char Str[120]; // [sp+ECh] [bp-3BCh]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17177 Actor Dst; // [sp+164h] [bp-344h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17178
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17179 //v131 = uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17180 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17181 dword_5B5920 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17182 dword_5B65C4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17183 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17185 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17186 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17187 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17189 v127 = 2 * (uActiveCharacter == 0) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17190 v122 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17191 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17193 v3 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17194 pSomeEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17195 v112 = pGlobalEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17197 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17199 v3 = uLevelEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17200 pSomeEVT = pLevelEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17201 v112 = pLevelEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17203 uSomeEVT_NumEvents = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17204 memcpy(pSomeEVT_Events, v112, 0xCE40u);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17205 //v4 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17206 //v124 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17207 for (uint i = 0; i < uSomeEVT_NumEvents; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17208 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17209 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17210 //v6 = v123;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17211 //v7 = nullstring;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17212 //while ( 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17213 //{
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17214 if ( dword_5B65C4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17215 goto LABEL_301;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17216 //v8 = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17217 if ( pSomeEVT_Events[i/*v4*/].uEventID == uEventID && pSomeEVT_Events[i/*v4*/].field_4 == v122 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17218 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17219 //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17220 //v10 = (ByteArray *)&v5[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17221 auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17222
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17223 switch (_evt->v4)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17225 case EVENT_CheckSeason:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17226 if ( !sub_4465DF_check_season(_evt->v5) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17227 goto LABEL_291;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17228 v11 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17229 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17230 case EVENT_ShowMovie:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17231 strcpy(Source, (char *)&_evt->v7);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17232 v12 = (char *)&item.uExpireTime + strlen(Source) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17233 if ( *v12 == 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17234 *v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17235 if ( pVideoPlayer->field_54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17236 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17237 pVideoPlayer->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17238 pVideoPlayer->field_40 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17239 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17240 pAsyncMouse->Suspend();
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
17241 v128 = pCurrentScreen;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17242 //v13 = &pSomeEVT[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17243 //v14 = (unsigned __int8)v13[5];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17244 //v15 = (unsigned __int8)v13[6];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17245 v14 = _evt->v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17246 v15 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17247 strcpy(Str, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17248 v16 = RemoveQuotes(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17249 VideoPlayer::MovieLoop(v16, 0, v14, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17250 if ( !_strcmpi(v16, "arbiter good") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17252 pParty->uAlignment = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17253 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17254 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17255 LOBYTE(v17) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17256 SetUserInterface(v18, v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17257 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17259 if ( !_strcmpi(v16, "arbiter evil") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17261 v18 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17262 pParty->uAlignment = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17263 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17265 if ( !_strcmpi(v16, "pcout01") ) // moving to harmondale from emerald isle
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17267 Rest(0x2760u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17268 pParty->RestAndHeal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17269 pParty->field_764 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17271 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17272 if ( !v15 || v128 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17273 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
17274 pCurrentScreen = v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17275 if ( v128 == 3 )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
17276 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17277 if ( v128 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17278 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17279 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17280 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17281 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17282 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17283 case EVENT_CheckSkill:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17284 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17285 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17286 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17287 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17288 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17289 v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + _evt->v5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17291 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17293 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17294 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17295 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17297 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17299 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17301 v20 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17302 v21 = 3486 * v130 + _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17303 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17304 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17305 v137 = v21 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17306 v138 = v21 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17307 v22 = v21 & 0x100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17308 v23 = v21 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17309 v139 = v22;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17310 while ( v23 < v19 || !*(&v136 + _evt->v6) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17312 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17313 if ( v20 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17314 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17316 LABEL_50:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17317 v11 = _evt->v11;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17318 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17319 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17320 LABEL_47:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17321 //v10 = (ByteArray *)&v5[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17322 v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17325 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17326 v137 = v24 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17327 v138 = v24 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17328 v139 = v24 & 0x100;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17329 if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17330 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17331 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17332 case EVENT_SpeakNPC:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17333 if ( a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17335 //Actor::Actor(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17336 memset(&Dst, 0, 0x344u);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17337 dword_5B65D0_dialogue_actor_npc_id = _evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17338 + ((_evt->v6
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17339 + ((_evt->v7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17340 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17341 Dst.uNPC_ID = dword_5B65D0_dialogue_actor_npc_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17342 Dst.InitializeDialogue(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17344 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17345 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17346 bDialogueUI_InitializeActor_NPC_ID = _evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17347 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17349 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17350 case EVENT_ChangeEvent:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17351 v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17352 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17353 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17354 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = _evt->v5 - 124;
0
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 v26 = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17359 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17360 LOBYTE(v26->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17362 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17363 case EVENT_SetNPCGreeting:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17364 v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17365 v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17366 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17367 pNPCStats->pNewNPCData[v27].greet = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17368 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17369 case EVENT_SetNPCTopic:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17370 v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17371 v30 = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17372 v31 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17373 v32 = _evt->v9;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17374 v33 = &pNPCStats->pNewNPCData[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17375 if ( v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17377 v34 = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17378 if ( v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17380 v35 = v34 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17381 if ( v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17383 v36 = v35 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17384 if ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17386 v37 = v36 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17387 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17389 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17390 v33->evtf = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17391 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17392 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17394 v33->evte = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17397 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17399 v33->evtd = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17402 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17404 v33->evtc = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17405 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17407 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17409 v33->evtb = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17412 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17414 v33->bDrawSomeAnim = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17416 if ( v29 == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17418 if ( v30 == 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17420 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17421 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17422 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17423 if ( EnterHouse((enum HOUSE_TYPE)170) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17425 pAudioPlayer->StopChannels(-1, -1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17426 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17427 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17428 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17429 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17430 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17431 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17432 ptr_F8B1E8 = pNPCTopics[90].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17436 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17437 case EVENT_NPCSetItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17438 sub_448518_npc_set_item(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17439 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17440 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17441 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17442 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17443 case EVENT_SetActorItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17444 Actor::GiveItem(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17445 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17446 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17447 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17448 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17449 case EVENT_SetNPCGroupNews:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17450 pNPCStats->pGroups_copy[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)] = _evt->v9 + ((uint)_evt->v10 << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17451 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17452 case EVENT_SetActorGroup:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17453 __debugbreak();
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17454 *(&pActors[0].uGroup + 0x11000000 * _evt->v8 + 209 * (_evt->v5 + ((_evt->v6 + ((uint)_evt->v7 << 8)) << 8))) = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17455 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17456 case EVENT_ChangeGroup:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17457 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17458 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17459 v40 = uNumActors;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17460 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17461 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17462 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17463 v41 = (char *)&pActors[0].uGroup;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17464 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17466 if ( *(int *)v41 == v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17467 *(int *)v41 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17468 v41 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17469 --v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17470 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17471 while ( v40 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17473 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17474 case EVENT_ChangeGroupAlly:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17475 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17476 v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17477 v44 = uNumActors;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17478 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17479 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17481 v45 = (char *)&pActors[0].uAlly;
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 if ( *((int *)v45 - 1) == v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17485 *(int *)v45 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17486 v45 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17487 --v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17489 while ( v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17491 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17492 case EVENT_MoveNPC:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17493 pNPCStats->pNewNPCData[_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)].house = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17494 if ( ptr_507BC0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17496 v46 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17497 if ( v46 == (void *)165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17499 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17500 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17501 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17502 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17503 _5C3420_pDecoration = (LevelDecoration *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17504 if ( EnterHouse((enum HOUSE_TYPE)165) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17505 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17506 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17507 v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17508 ptr_507BC0 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17509 v48 = v47->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17510 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17512 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17514 v49 = v48->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17515 pAllocator->FreeChunk(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17516 v48 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17518 while ( v49 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17519 v47 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17521 v47->pControlsHead = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17522 ptr_507BC0->pControlsTail = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17523 ptr_507BC0->uNumControls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17526 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17528 if ( v46 == (void *)553 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17529 pVideoPlayer->bLoopPlaying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17532 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17533 case EVENT_Jmp:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17534 //v124 = -1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17535 v122 = _evt->v5 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17536 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17537 case EVENT_ShowFace:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17538 v50 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17539 if ( (unsigned __int8)v50 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17541 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17542 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17543 v53 = (unsigned __int8)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17544 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17546 if ( v50 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17548 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17549 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17550 v52 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17551 goto LABEL_109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17553 if ( v50 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17555 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17556 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17557 v53 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17558 LABEL_108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17559 v52 = &pParty->pPlayers[v53];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17560 LABEL_109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17561 v52->PlayEmotion(v113, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17562 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17564 v51 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17565 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17566 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17567 v51->PlayEmotion(_evt->v6, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17568 ++v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17570 while ( (signed int)v51 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17571 LABEL_291:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17572 ++v122;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17573 //v4 = v124;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17574 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17575 //v6 = v123;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17576 //v7 = nullstring;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17577 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17578 case EVENT_CharacterAnimation:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17579 v54 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17580 if ( (unsigned __int8)v54 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17582 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17583 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17584 v57 = (unsigned __int8)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17585 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17587 if ( v54 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17589 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17590 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17591 v56 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17592 goto LABEL_120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17594 if ( v54 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17596 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17597 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17598 v57 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17599 LABEL_119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17600 v56 = &pParty->pPlayers[v57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17601 LABEL_120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17602 v56->PlaySound(v114, v118);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17603 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17605 v55 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17606 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17607 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17608 v55->PlaySound(_evt->v6, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17609 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17611 while ( (signed int)v55 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17612 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17613 case EVENT_ForPartyMember:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17614 v127 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17615 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17616 case EVENT_SummonItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17617 sub_42F7EB_DropItemAt(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17618 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17619 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17620 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17621 _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17622 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17623 _evt->v25,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17624 _evt->v26,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17625 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17626 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17627 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17628 case EVENT_Compare:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17629 v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17630 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17632 v130 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17633 v59 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17634 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17636 LOBYTE(v60) = v59->CompareVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17637 (enum VariableType)(_evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17638 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17639 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17640 if ( v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17641 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17642 ++v130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17643 ++v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17644 if ( (signed int)v59 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17645 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17647 LABEL_129:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17648 v11 = _evt->v11;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17649 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17651 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17652 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17653 v61 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17654 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17655 goto LABEL_137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17656 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17658 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17659 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17660 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17661 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17662 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17664 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17666 if ( v127 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17667 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17669 v61 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17670 //v5 = pSomeEVT;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17671 LABEL_137:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17672 v6 = &pParty->pPlayers[v61];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17673 LABEL_138:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17674 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17675 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17676 LOBYTE(v62) = ((Player *)v6)->CompareVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17677 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17678 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17679 LABEL_140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17680 if ( v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17681 goto LABEL_129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17682 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17683 case EVENT_IsActorAlive:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17684 v62 = IsActorAlive(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17685 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17686 _evt->v6 + ((_evt->v7 + ((_evt->v8 + ((uint)_evt->v9 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17687 _evt->v10);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17688 goto LABEL_140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17689 case EVENT_Substract:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17690 v63 = (void *)(_evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8));
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17691 if ( _evt->v5 + ((uint)_evt->v6 << 8) == VAR_PlayerItemInHands )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17693 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17694 if ( (void *)pParty->pPickedItem.uItemID == v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17696 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17697 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17699 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17700 v66 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17701 v67 = (int)v66->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17702 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17703 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17704 if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17706 v66->RemoveItemAtInventoryIndex(v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17707 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17709 ++v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17710 v67 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17712 while ( (signed int)v65 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17713 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17714 v69 = (int)&v66->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17715 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17716 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17717 if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17719 *(&v66->pEquipment.uOffHand + v68) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17720 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17721 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17722 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17723 v69 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17725 while ( v68 < 16 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17726 v125 = (signed int)&pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17727 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17729 v70 = *(Player **)v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17730 if ( !v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17732 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17733 v72 = (int)v70->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17734 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17735 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17736 if ( *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v72 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17738 v70->RemoveItemAtInventoryIndex(v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17739 goto LABEL_169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17741 ++v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17742 v72 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17744 while ( (signed int)v71 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17745 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17746 v74 = (int)&v70->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17747 while ( !*(int *)v74
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17748 || *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v74 + 5] != v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17749 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17750 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17751 v74 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17752 if ( v73 >= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17753 goto LABEL_170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17754 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17755 *(&v70->pEquipment.uOffHand + v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17756 LABEL_169:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17757 v64 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17758 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17759 LABEL_170:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17760 v125 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17761 if ( v125 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17762 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17765 v75 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17766 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17768 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17769 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17770 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17772 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17774 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17775 goto LABEL_180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17776 LABEL_183:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17777 ((Player *)v6)->SubtractVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17778 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17779 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17780 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17782 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17783 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17784 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17785 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17787 LABEL_180:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17788 v75 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17789 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17790 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17791 v6 = &pParty->pPlayers[v75];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17792 LABEL_182:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17793 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17794 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17796 v76 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17797 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17798 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17800 v76->SubtractVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17801 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17802 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17803 ++v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17805 while ( (signed int)v76 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17806 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17807 case EVENT_Set:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17808 v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17809 v78 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17810 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17812 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17813 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17814 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17816 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17818 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17819 goto LABEL_194;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17820 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17821 ((Player *)v6)->SetVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17822 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17823 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17824 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17826 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17827 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17828 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17829 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17831 LABEL_194:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17832 v78 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17833 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17834 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17835 v6 = &pParty->pPlayers[v78];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17836 LABEL_196:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17837 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17838 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17840 v79 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17841 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17842 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17843 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17844 v79->SetVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17845 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17846 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17847 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17849 while ( (signed int)v79 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17850 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17851 case EVENT_Add:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17852 v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17853 v81 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17854 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17856 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17857 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17858 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17859 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17860 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17862 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17863 goto LABEL_208;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17864 LABEL_211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17865 ((Player *)v6)->AddVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17866 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17867 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17868 goto LABEL_212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17870 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17871 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17872 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17873 goto LABEL_210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17875 LABEL_208:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17876 v81 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17877 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17878 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17879 v6 = &pParty->pPlayers[v81];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17880 LABEL_210:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17881 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17882 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17883 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17884 v82 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17885 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17886 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17888 v82->AddVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17889 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17890 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17891 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17893 while ( (signed int)v82 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17894 LABEL_212:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17895 v83 = _evt->v5 + ((uint)_evt->v6 << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17896 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17897 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17898 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17899 case EVENT_InputString:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17900 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17901 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17902 strcpy(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17903 GameUI_StatusBar_TimedString,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17904 &pLevelStr[pLevelStrOffsets[_evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17905 + ((_evt->v6
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17906 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17907 v105 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17908 v121 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17909 LABEL_295:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17910 sub_4451A8_press_any_key(uEventID, v105, v121);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17911 LABEL_301:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17912 if ( v133 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17913 LABEL_302:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17914 OnMapLeave();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17915 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17916 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17917 v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17918 if ( !_strcmpi(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17919 GameUI_StatusBar_TimedString,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17920 &pLevelStr[pLevelStrOffsets[_evt->v9
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17921 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17922 || !_strcmpi(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[v84]]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17923 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17924 v11 = _evt->v17;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17925 LABEL_130:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17926 //v124 = -1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17927 LABEL_131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17928 v122 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17930 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17931 case EVENT_RandomGoTo:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17932 //v124 = -1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17933 v11 = (unsigned __int8)*(&_evt->v5
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17934 + rand()
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17935 % ((_evt->v5 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17936 + (_evt->v6 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17937 + (_evt->v7 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17938 + (_evt->v8 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17939 + (_evt->v9 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17940 + (_evt->v10 != 0)));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17941 goto LABEL_131;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17942 case EVENT_ReceiveDamage:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17943 v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17944 v86 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17945 if ( (unsigned __int8)v86 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17946 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17947 v119 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17948 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17949 v89 = (unsigned __int8)v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17950 goto LABEL_233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17952 if ( v86 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17954 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17955 goto LABEL_291;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17956 v119 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17957 v88 = pPlayers[uActiveCharacter];
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17958 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17959 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17961 if ( v86 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17962 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17963 v119 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17964 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v1 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17965 v89 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17966 LABEL_233:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17967 v88 = &pParty->pPlayers[v89];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17968 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17969 v88->ReceiveDamage(v115, v119);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17970 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17972 v87 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17973 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17974 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17975 v87->ReceiveDamage(v85, _evt->v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17976 ++v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17978 while ( (signed int)v87 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17979 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17980 case EVENT_ToggleIndoorLight:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17981 pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17982 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17983 case EVENT_SetFacesBit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17984 sub_44892E_set_faces_bit(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17985 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17986 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17987 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17988 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17989 case EVENT_ToggleChestFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17990 Chest::ToggleFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17991 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17992 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17993 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17994 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17995 case EVENT_ToggleActorFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17996 Actor::ToggleFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17997 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17998 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17999 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18000 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18001 case EVENT_ToggleActorGroupFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18002 ToggleActorGroupFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18003 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18004 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18005 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18006 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18007 case EVENT_SetSnow:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18008 if ( !_evt->v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18009 pWeather->bRenderSnow = _evt->v6 != 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18010 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18011 case EVENT_StatusText:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18012 v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18013 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18015 if ( _5C3420_pDecoration == (LevelDecoration *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18017 ptr_F8B1E8 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18018 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18019 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18020 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18022 v91 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18023 LABEL_248:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18024 ShowStatusBarString(v91, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18025 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18028 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18030 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18032 v91 = &pLevelStr[pLevelStrOffsets[v90]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18033 goto LABEL_248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18036 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18037 case EVENT_ShowMessage:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18038 v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18039 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18041 v93 = (&dword_721664)[8 * v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18042 byte_5B0938[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18043 ptr_F8B1E8 = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18045 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18047 strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18049 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18050 case EVENT_CastSpell:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18051 sub_448DF8_cast_spell(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18052 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18053 _evt->v6,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18054 _evt->v7,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18055 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18056 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18057 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18058 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18059 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18060 _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18061 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18062 case EVENT_SetTexture:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18063 sub_44861E_set_texture(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), (char *)&_evt->v9);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18064 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18065 case EVENT_SetSprite:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18066 SetDecorationSprite(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18067 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18068 _evt->v9,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18069 (char *)&_evt->v10);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18070 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18071 case EVENT_SummonMonsters:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18072 sub_448CF4_spawn_monsters(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18073 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18074 _evt->v6,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18075 _evt->v7,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18076 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18077 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18078 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18079 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18080 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18081 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18082 case EVENT_MouseOver:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18083 case EVENT_LocationName:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18084 --v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18085 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18086 case EVENT_ChangeDoorState:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18087 sub_449A49_door_switch_animation(_evt->v5, _evt->v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18088 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18089 case EVENT_OpenChest:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18090 if ( !Chest::Open(_evt->v5) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18091 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18092 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18093 case EVENT_MoveToMap:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18094 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18095 v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18096 v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18097 v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18098 v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18099 v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18100 v96 = _evt->v25;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18101 v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18102 v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18103 if ( _evt->v29 || _evt->v30 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18105 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18106 pRenderer->_49FD3A();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18107 sub_444839_move_map(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18108 _evt->v29,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18109 _evt->v30,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18110 v135,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18111 v132,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18112 v126,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18113 v129,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18114 v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18115 v134,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18116 (char *)&_evt->v31);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18117 dword_5C3418 = uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18118 dword_5C341C = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18119 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18120 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18121 _5B65AC_npcdata_fame_or_other = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18122 _5B65A8_npcdata_uflags_or_other = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18123 _5B65B0_npcdata_rep_or_other = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18124 if ( v129 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18126 v98 = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18128 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18130 v98 = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18131 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18132 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18133 v99 = (char *)&_evt->v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18134 _5B65B8_npcdata_hiword_house_or_other = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18135 dword_5B65BC = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18136 v100 = v94 | v132 | v126 | v95 | v97 | v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18137 dword_5B65C0 = v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18138 if ( *v99 == 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18140 if ( v100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18142 pParty->vPosition.x = v135;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18143 pParty->vPosition.z = v132;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18144 pParty->vPosition.y = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18145 pParty->uFallStartY = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18146 if ( _5B65B4_npcdata_loword_house_or_other != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18147 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18148 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18149 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18150 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18151 v111 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18152 v110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18153 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18154 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18155 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18156 pParty->sRotationX = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18157 pParty->uFallSpeed = v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18158 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18159 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18160 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18161 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18162 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18163 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18164 v106 = 232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18165 LABEL_280:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18166 pAudioPlayer->PlaySound((SoundID)v106, v107, v108, v109, v110, v111, v116, v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18167 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18169 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18170 {
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18171 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((_5C3420_pDecoration == 0) + 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18172 sub_44987B(v99, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18173 v133 = 1;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
18174 if ( pCurrentScreen == 13 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18175 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18176 if ( uGameState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18178 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18179 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18180 while ( sub_4BD8B5() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18181 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18182 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18183 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18184 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18185 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18186 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
18187 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18188 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18189 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18190 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18191 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18192 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18193 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18195 goto LABEL_302;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18198 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18199 case EVENT_PlaySound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18200 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18201 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18202 v111 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18203 v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18204 v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18205 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18206 v107 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18207 v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18208 goto LABEL_280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18209 case EVENT_GiveItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18210 item.Reset();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18211 //v101 = &pSomeEVT[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18212 v102 = _evt->v7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18213 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18214 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18215 if ( v102 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18216 item.uItemID = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18217 pParty->SetHoldingItem(&item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18218 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18219 case EVENT_SpeakInHouse:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18220 v103 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18221 if ( EnterHouse((enum HOUSE_TYPE)(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8))) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18223 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18224 pRenderer->_49FD3A();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18225 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18226 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18227 v104 = 187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18228 if ( uCurrentHouse_Animation != 167 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18229 v104 = v103;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
18230 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18231 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18232 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18233 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18234 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18235 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18237 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18238 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18239 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18240 case EVENT_PressAnyKey:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18241 v121 = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18242 v105 = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18243 goto LABEL_295;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18244 case EVENT_Exit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18245 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18247 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18248 //++v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18249 //v124 = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18250 //if ( v4 >= (signed int)uSomeEVT_NumEvents )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18251 //goto LABEL_301;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18252 //}
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18254 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18256
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18257
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18258 //----- (0044861E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18259 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18261 unsigned int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18262 unsigned __int16 v3; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18263 signed int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18264 BLVFace *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18265 unsigned int *v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18266 char *v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18267 int v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18268 char *v9; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18269 ODMFace *v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18270 unsigned int *v11; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18271 unsigned __int16 v12; // [sp+Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18272 const char *Str2; // [sp+10h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18273 unsigned int v14; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18274 signed int v15; // [sp+18h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18275 int v16; // [sp+1Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18276 signed int v17; // [sp+20h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18277 signed int v18; // [sp+20h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18279 Str2 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18280 v14 = uFaceCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18281 if ( uFaceCog )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18283 v2 = pBitmaps_LOD->LoadTexture(pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18284 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18285 v12 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18286 if ( v2 != -1 ? (int)&pBitmaps_LOD->pTextures[v2] : 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18287 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
18288 pBitmaps_LOD->pTextures[v2].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v2].palette_id1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18290 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18292 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18293 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18295 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18296 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18298 if ( pIndoor->pFaceExtras[v4].sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18300 v5 = &pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18301 if ( BYTE1(v5->uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18303 pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18304 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18305 v6 = (unsigned int *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18306 if ( *(_WORD *)v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18308 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18310 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18312 *(_WORD *)v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18313 v7 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18314 v7[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18317 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18319 v5->uBitmapID = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18322 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18323 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18325 while ( v17 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18326 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18327 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18329 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18331 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18332 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18334 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18335 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18337 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18338 v9 = (char *)&pOutdoor->pBModels[v16].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18339 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18340 if ( (signed int)pOutdoor->pBModels[v16].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18342 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18344 v10 = (ODMFace *)(v8 + *((_DWORD *)v9 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18345 if ( v10->sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18347 if ( BYTE1(v10->uFaceAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18349 *(_WORD *)(*((_DWORD *)v9 + 4) + v8 + 272) = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18350 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18351 v11 = (unsigned int *)(*((_DWORD *)v9 + 4) + v8 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18352 if ( *(_WORD *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18354 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18356 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18358 *(_WORD *)v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18359 *(_BYTE *)(*((_DWORD *)v9 + 4) + v8 + 29) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18362 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18364 v10->uTextureID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18367 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18368 v8 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18370 while ( v18 < *((_DWORD *)v9 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18372 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18373 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18375 while ( v15 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18378 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18382
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18383
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18384
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18385
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18386 //----- (0044882F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18387 void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18389 signed int v3; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18390 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18391 unsigned __int16 v5; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18392 unsigned int v6; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18393 int v7; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18394
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18395 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18396 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18397 v6 = uCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18398 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18400 v4 = (char *)&pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18401 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18403 if ( *((_WORD *)v4 + 9) == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18404 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18405 if ( pFileName && _strcmpi(pFileName, "0") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18407 v5 = pDecorationList->GetDecorIdByName(pFileName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18408 *((_WORD *)v4 - 1) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18409 pDecorationList->InitializeDecorationSprite((signed __int16)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18411 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18412 *v4 &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18413 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18414 *v4 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18415 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18417 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18418 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18420 while ( v3 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18423
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18424
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18425 //----- (004488B6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18426 unsigned __int16 DecorationList::GetDecorIdByName(const char *pName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18428 DecorationList *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18429 signed int uID; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18430 signed int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18431 unsigned __int16 result; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18432
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18433 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18434 if ( pName && (uID = 1, (signed int)this->uNumDecorations > 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18436 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18437 while ( _strcmpi(pName, v2->pDecorations[v4].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18439 ++uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18440 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18441 if ( uID >= (signed int)v2->uNumDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18442 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18444 result = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18446 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18448 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18449 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18451 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18453
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18454
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18455 //----- (0044892E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18456 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18457 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18458 signed int v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18459 signed int v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18460 char *v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18461 int v6; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18462 char *v7; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18463 signed int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18464 ODMFace *v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18465 int v10; // [sp+0h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18466 signed int v11; // [sp+4h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18467 int v12; // [sp+8h] [bp-4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18468
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18469 v10 = sCogNumber;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18470 if ( sCogNumber )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18471 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18472 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18473 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18475 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18477 v4 = 1;
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 if ( pIndoor->pFaceExtras[v4].sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18482 v5 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18483 if ( on )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18484 *(_DWORD *)v5 |= bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18485 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18486 *(_DWORD *)v5 &= ~bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18487 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18488 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18489 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18491 while ( v3 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18493 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18495 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18497 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18498 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18500 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18501 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18503 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18504 v7 = (char *)&pOutdoor->pBModels[v12].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18505 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18506 if ( (signed int)pOutdoor->pBModels[v12].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18508 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18510 v9 = (ODMFace *)(v6 + *((_DWORD *)v7 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18511 if ( v9->sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18513 if ( on )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18514 v9->uFaceAttributes |= bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18515 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18516 v9->uFaceAttributes &= ~bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18518 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18519 v6 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18521 while ( v8 < *((_DWORD *)v7 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18523 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18524 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18526 while ( v11 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18529 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18532
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18533
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18534 //----- (00448A17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18535 void Chest::ToggleFlag(unsigned int uChestID, unsigned __int16 uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18537 unsigned __int16 *pFlags; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18538
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18539 if ( (uChestID & 0x80000000u) == 0 && (signed int)uChestID <= 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18541 pFlags = &pChests[uChestID].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18542 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18543 *pFlags |= uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18544 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18545 *pFlags &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18546 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18548
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18549 //----- (00448A40) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18550 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18552 unsigned __int16 *pState; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18553
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18554 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18556 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18558 pActors[uActorID].uAttributes |= uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18560 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18562 if ( uFlag == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18564 pState = &pActors[uActorID].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18565 if ( *pState == Disabled )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18566 *pState = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18568 pActors[uActorID].uAttributes &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18572
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18573 //----- (00448A98) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18574 void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18576 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18577 unsigned int v4; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18578 signed int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18579 char *v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18580 size_t v7; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18581 char *v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18582 unsigned __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18583
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18584 v4 = uGroupID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18585 v5 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18586 v3 = uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18587 if ( uGroupID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18589 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18591 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18593 v6 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18594 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18596 if ( *((_DWORD *)v6 + 168) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18598 *(_DWORD *)v6 |= v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18599 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18601 *((_WORD *)v6 + 70) = Disabled;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18602 ((Actor *)(v6 - 36))->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18605 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18606 v6 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18608 while ( v5 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18611 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18613 v7 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18614 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18616 v8 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18617 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18619 if ( *((_DWORD *)v8 + 133) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18621 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18623 v9 = *(_WORD *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18624 if ( *(_WORD *)v8 != Dead )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18626 if ( v9 != 4 && v9 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18627 *(_WORD *)v8 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18628 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18630 *((_DWORD *)v8 - 35) &= ~v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18632 v8 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18633 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18635 while ( v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18640
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18641
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18642 //----- (00448B45) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18643 void __thiscall GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18645 if ( bForceHide || GameUI_StatusBar_TimedStringTimeLeft && GetTickCount() >= GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18646 GameUI_StatusBar_TimedStringTimeLeft = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18648
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18649 //----- (00448B67) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18650 void __thiscall OnTimer(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18652 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18653 unsigned int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18654 unsigned int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18655 char *v4; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18656 __int16 v5; // ax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18657 int v6; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18658 unsigned int v7; // ebp@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18659 int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18660 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18661 unsigned __int64 v10; // qax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18662 int v11; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18663 int v12; // [sp+Ch] [bp-10h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18664 unsigned int v13; // [sp+10h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18665
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18666 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18667 if ( !pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18669 if ( a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18670 dword_5773C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18671 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18672 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18673 v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18674 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18676 _5773B8_event_timer = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18677 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18678 if ( dword_5B65C8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18680 v4 = (char *)&array_5B5928[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18681 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18683 v5 = *(short *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18684 if ( *(short *)v4 != (short)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18685 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18686 v7 = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18687 if ( v7 <= v3 && (v7 < v3 || *((int *)v4 - 3) <= v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18689 if ( *((short *)v4 + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18691 v8 = 29030400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18693 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18695 if ( *((short *)v4 + 3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18697 v8 = 2419200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18699 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18701 v9 = -(*((short *)v4 + 4) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18702 v8 = (v9 & 0x7E900) + 86400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18704 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18705 v10 = __PAIR__(v7, *((int *)v4 - 3)) + (signed __int64)((double)((signed __int64)v8 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18706 *((int *)v4 - 3) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18707 *((int *)v4 - 2) = HIDWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18708 if ( HIDWORD(v10) <= v3 && (HIDWORD(v10) < v3 || *((int *)v4 - 3) < v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18710 *((int *)v4 - 3) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18711 *((int *)v4 - 2) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18713 v11 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18714 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18715 EventProcessor(v11, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18716 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18717 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18718 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18719 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18721 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18722 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18723 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18724 if ( v12 >= dword_5B65C8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18725 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18726 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18728 if ( v13 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18730 *(short *)v4 = v5 - v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18731 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18733 v6 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18734 *(short *)v4 = *((short *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18735 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18736 EventProcessor(v6, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18737 dword_597F18 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18738 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18740 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18743
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18744 //----- (00481D77) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18745 void _outdoor_project(RenderVertexSoft *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18747 double v1; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18748 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18749
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18750 v1 = 1.0 / (v->vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18751 v->flt_20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18752 v2 = v1 * (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18753 v->vWorldViewProjX = (double)pViewport->uScreenCenterX - v2 * v->vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18754 v->vWorldViewProjY = (double)pViewport->uScreenCenterY - v2 * v->vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18756
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18757
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18758 //----- (00448CF4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18759 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
18760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18761 __int16 v8; // di@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18762 __int16 v9; // si@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18763 unsigned int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18764 size_t v11; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18765 signed int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18766 char *v13;//Actor_uYawAngle_cr *v13; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18767 AIDirection a3; // [sp+Ch] [bp-50h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18768 AIDirection v15; // [sp+28h] [bp-34h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18769 //SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18770
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18771 v8 = typeindex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18772 v9 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18773
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18774 SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18775 //SpawnPointMM7::SpawnPointMM7(&v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18776
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18777 v16.vPosition.x = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18778 v16.vPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18779 v16.vPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18780 v16.uGroup = group;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18781 v16.uRadius = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18782 v16.uKind = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18783 v16.uIndex = v8 + 2 * v9 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18784 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18785 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18787 v11 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18788 SpawnEncounter((MapInfo *)&pMapStats + v10, &v16, 0, count, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18789 memcpy(&v15, Actor::GetDirectionInfo(8 * v11 | AI_OBJECT_ACTOR, 4u, &a3, 1), sizeof(v15));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18790 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18791 if ( (signed int)v11 < (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18793 v13 = (char *)&pActors[v11].uYawAngle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18794 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18796 ((Actor *)((char *)v13 - 154))->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18797 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18798 *(short *)v13/*->uYawAngle*/ = LOWORD(v15.uYawAngle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18799 *(int *)(v13+666)/*->dword_000334_unique_name*/ = uUniqueName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18800 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18801 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18802 while ( v12 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18806
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18807
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18808 //----- (00448DF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18809 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
18810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18811 int v9; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18812 double v10; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18813 double v11; // st6@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18814 double v12; // st5@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18815 double v13; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18816 int v14; // ST44_4@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18817 signed int v15; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18818 signed int v16; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18819 char *v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18820 unsigned __int16 v18; // ax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18821 char *v19; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18822 int v20; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18823 signed int v21; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18824 char *v22; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18825 unsigned __int16 v23; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18826 int i; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18827 signed int v25; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18828 char *v26; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18829 unsigned __int16 v27; // ax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18830 int j; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18831 signed int v29; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18832 char *v30; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18833 unsigned __int16 v31; // ax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18834 char *v32; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18835 unsigned __int16 v33; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18836 int v34; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18837 int v35; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18838 unsigned __int64 v36; // qax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18839 SpellBuff *v37; // ecx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18840 int v38; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18841 signed __int64 v39; // qax@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18842 int v40; // ebx@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18843 int v41; // ebx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18844 int v42; // esi@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18845 int v43; // ebx@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18846 int v44; // eax@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18847 unsigned __int16 v45; // si@137
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18848 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18849 int v47; // [sp-4h] [bp-B8h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18850 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18851 int v49; // [sp+0h] [bp-B4h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18852 int v50; // [sp+0h] [bp-B4h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18853 int v51; // [sp+4h] [bp-B0h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18854 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18855 float v53; // [sp+14h] [bp-A0h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18856 float v54; // [sp+18h] [bp-9Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18857 int v55; // [sp+28h] [bp-8Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18858 unsigned int yaw; // [sp+30h] [bp-84h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18859 int pitch; // [sp+34h] [bp-80h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18860 //LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18861 int v59; // [sp+A8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18862 int v60; // [sp+ACh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18863 int spellnum_; // [sp+B0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18864 signed int levela; // [sp+BCh] [bp+8h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18865 int a6_4; // [sp+C8h] [bp+14h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18866 float a7a; // [sp+CCh] [bp+18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18867 signed int a7b; // [sp+CCh] [bp+18h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18868 int a7c; // [sp+CCh] [bp+18h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18869 int a7d; // [sp+CCh] [bp+18h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18870 float a8a; // [sp+D0h] [bp+1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18871 int a8b; // [sp+D0h] [bp+1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18872 int a8c; // [sp+D0h] [bp+1Ch]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18873 float toza; // [sp+D4h] [bp+20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18874
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18875 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18876 v59 = rank + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18877 spellnum_ = spellnum;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18878 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18879 if ( tox || toy || toz )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18881 v10 = (double)tox - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18882 v53 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18883 v11 = (double)toy - (double)fromy;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18884 v54 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18885 v12 = (double)toz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18887 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18888 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18889 v10 = (double)pParty->vPosition.x - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18890 v53 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18891 v11 = (double)pParty->vPosition.z - (double)fromy;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18892 v54 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18893 v12 = (double)(pParty->vPosition.y + pParty->sEyelevel);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18895 a7a = v12 - (double)fromz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18896 toza = v11 * v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18897 a8a = v10 * v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18898 v13 = sqrt(a7a * a7a + a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18899 if ( v13 <= 1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18901 LOBYTE(v55) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18902 yaw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18903 pitch = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18905 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18907 v55 = (signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18908 v14 = (signed __int64)sqrt(a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18909 yaw = stru_5C6E00->Atan2((signed __int64)v53, (signed __int64)v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18910 pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18911 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18912 v15 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18913 if ( v59 <= 0 || v59 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18914 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18915 a7b = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18916
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18917 LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18918 //LayingItem::LayingItem(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18919
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18920 a1.uItemType = stru_4E3ACC[spellnum_].uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18921 if ( spellnum_ > 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18923 if ( spellnum_ == 69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18924 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18925 if ( spellnum_ != 83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18926 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18927 v40 = v15 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18928 if ( v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18930 v41 = v40 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18931 if ( !v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18933 v42 = 14400 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18934 v43 = 4 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18935 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18936 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18937 if ( v41 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18939 v42 = 18000 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18940 v43 = 5 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18941 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18944 v42 = 10800 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18945 v43 = 3 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18946 LABEL_114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18947 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18948 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18949 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18950 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18951 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18952 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18953 v48 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18954 v46 = a7b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18955 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18956 v37 = &pParty->pPartyBuffs[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18957 LABEL_115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18958 v36 = pParty->uTimePlayed + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18959 LABEL_116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18960 v37->Apply(v36, v46, v48, v50, v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18961 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18963 if ( spellnum_ != 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18965 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18967 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18968 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18969 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18970 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18971 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18972 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18973 case 39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18974 case 41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18975 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18976 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18977 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18978 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18979 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18980 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18981 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18982 v17 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18983 while ( (short)a1.uItemType != *(short *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18985 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18986 v17 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18987 if ( v16 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18988 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18990 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18991 v18 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18992 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18993 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18994 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18996 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18997 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18998 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18999 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19000 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19001 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19002 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19003 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19004 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19005 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19006 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19007 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19009 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19010 if ( v60 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19012 a8b = a7c / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19013 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19014 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19015 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19016 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19017 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19018 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19019 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19020 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19021 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19023 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19025 v22 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19026 while ( (short)a1.uItemType != *(short *)v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19028 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19029 v22 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19030 if ( v21 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19031 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19033 v23 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19035 a1.uObjectDescID = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19036 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19037 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19038 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19039 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19040 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19041 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19042 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19043 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19044 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19045 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19047 a1.uFacing = i + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19048 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19049 (signed __int16)(i + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19050 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19051 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19052 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19054 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19056 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19057 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19058 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19059 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19060 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19061 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19062 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19063 v19 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19064 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19066 if ( (short)a1.uItemType == *(short *)v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19067 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19068 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19069 v19 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19071 while ( v16 < (signed int)pObjectList->uNumObjects );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19072 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19073 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19074 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19075 a1.uObjectDescID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19076 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19077 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19078 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19079 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19080 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19081 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19082 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19083 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19084 a1.field_5C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19085 a1.uFacing = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19086 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19087 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19088 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19089 v47 = pitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19090 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19091 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19092 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19094 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19095 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19096 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19097 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19098 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19099 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19100 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19101 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19102 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19103 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19104 v60 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19105 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19107 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19108 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19109 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19110 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19111 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19112 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19113 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19114 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19115 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19116 v26 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19117 while ( (short)a1.uItemType != *(short *)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19118 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19119 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19120 v26 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19121 if ( v25 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19123 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19124 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19125 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19128 v27 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19129 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19130 a1.uObjectDescID = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19131 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19132 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19133 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19134 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19135 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19136 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19137 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19138 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19139 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19140 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19142 a1.uFacing = j + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19143 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19144 (signed __int16)(j + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19145 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19146 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19147 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19149 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19150 case 43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19151 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19152 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19153 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19154 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19155 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19156 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19157 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19158 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19159 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19160 v30 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19161 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19162 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19163 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19165 if ( v15 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19167 v9 = 60 * (level + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19169 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19170 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19171 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19173 v9 = 180 * (level + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19175 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19176 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19177 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19178 v9 = 240 * (level + 15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19182 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19183 v32 = (char *)&pParty->pPlayers[0].pConditions[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19184 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19186 if ( *(_QWORD *)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19187 levela = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19188 v32 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19190 while ( (signed int)v32 < (signed int)&pParty->pHirelings[0].uFlags );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19191 if ( !levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19192 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19193 pParty->pPartyBuffs[8].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19194 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19195 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19196 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19197 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19198 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19199 v33 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19200 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19201 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19202 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19203 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19204 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19205 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19206 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19207 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19208 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19210 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19211 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19212 v9 = 300 * (level + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19213 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19214 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19215 v9 = 900 * (level + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19216 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19217 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19218 v9 = 3600 * (level + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19219 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19221 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19223 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19224 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19225 level = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19226 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19227 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19228 v35 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19229 level = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19230 v60 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19231 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19232 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19233 v34 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19234 level = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19235 v60 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19236 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19238 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19239 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19240 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19241 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19242 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19243 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19244 v48 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19245 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19246 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19247 v37 = &pParty->pPartyBuffs[level];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19248 goto LABEL_116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19249 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19250 if ( v15 == 2 || v15 == 3 || v15 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19251 v38 = 60 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19252 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19253 v38 = 600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19254 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19255 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19256 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19257 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19258 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19259 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19260 v48 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19261 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19262 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19263 v37 = &pParty->pPartyBuffs[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19264 goto LABEL_115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19265 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19266 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19267 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19268 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19269 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19270 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19271 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19272 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19273 while ( (short)a1.uItemType != *(short *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19275 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19276 v30 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19277 if ( v29 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19279 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19280 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19281 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19284 v31 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19285 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19286 a1.uObjectDescID = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19287 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19288 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19289 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19290 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19291 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19292 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19293 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19294 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19295 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19296 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19297 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19298 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19299 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19300 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19301 a1.Create(v20, v47, v49, v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19302 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19304 LABEL_117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19305 v44 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19306 a6_4 = 3600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19307 if ( v15 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19309 LABEL_124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19310 v60 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19311 goto LABEL_125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19313 if ( v15 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19315 v44 = 2 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19316 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19318 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19320 v44 = 3 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19321 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19323 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19325 v44 = 4 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19326 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19328 LABEL_125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19329 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19331 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19332 level = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19333 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19334 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19335 level = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19336 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19337 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19338 level = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19339 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19340 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19341 level = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19342 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19343 case 58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19344 level = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19345 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19346 case 69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19347 level = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19348 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19350 v45 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19351 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19352 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19353 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19354 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19355 pParty->pPartyBuffs[level].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19356 pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19357 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19358 v60,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19359 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19360 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19361 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19362 LABEL_138:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19363 if ( levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19364 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19365 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum_], 0, 0, fromx, fromy, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19367 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19368
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19369 //----- (0044987B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19370 char *__fastcall sub_44987B(const char *pMapName, unsigned int uStartingPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19372 const char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19373 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19374 char *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19375
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19376 v2 = pMapName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19377 v3 = uStartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19378 pAudioPlayer->StopChannels(-1, -1);
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19379 pGameLoadingUI_ProgressBar->_443484((GUIProgressBar::Type)0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19380 if ( _strcmpi(pCurrentMapName, v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19381 SaveGame(1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19382 uGameState = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19383 result = strcpy(pCurrentMapName, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19384 uLevel_StartingPointType = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19385 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19387 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19388
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19389 //----- (004498D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19390 void __thiscall TeleportToStartingPoint(unsigned int uPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19392 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19393 int v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19394 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19395 unsigned __int16 v4; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19396 signed int v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19397 LevelDecoration *v6; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19398 signed int v7; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19399 int v8; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19400 int v9; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19401 const char *v10; // [sp-4h] [bp-84h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19402 char pName[128]; // [sp+8h] [bp-78h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19403
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19404 if ( uPointType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19406 v1 = uPointType - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19407 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19409 v2 = v1 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19410 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19412 v3 = v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19413 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19415 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19416 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19417 v10 = "West Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19419 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19421 v10 = "East Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19422 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19424 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19425 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19426 v10 = "South Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19429 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19431 v10 = "North Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19434 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19436 v10 = "Party Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19437 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19438 strcpy(pName, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19439 v4 = pDecorationList->GetDecorIdByName(pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19440 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19442 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19443 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19445 v6 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19446 while ( v6->uDecorationDescID != (signed __int16)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19448 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19449 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19450 if ( v5 >= (signed int)uNumLevelDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19451 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19453 v7 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19454 pParty->vPosition.x = pLevelDecorations[v7].vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19455 pParty->vPosition.z = pLevelDecorations[v7].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19456 pParty->vPosition.y = pLevelDecorations[v7].vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19457 pParty->uFallStartY = pParty->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19458 v8 = (signed int)(stru_5C6E00->uIntegerHalfPi * pLevelDecorations[v7].field_1A) / 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19459 v9 = pLevelDecorations[v7].field_10_y_rot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19460 pParty->sRotationY = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19461 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19462 pParty->sRotationY = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19463 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19464 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19466 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19467 if ( dword_5B65C0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19469 if ( _5B65A8_npcdata_uflags_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19470 pParty->vPosition.x = _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19471 if ( _5B65AC_npcdata_fame_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19472 pParty->vPosition.z = _5B65AC_npcdata_fame_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19473 if ( _5B65B0_npcdata_rep_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19475 pParty->vPosition.y = _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19476 pParty->uFallStartY = _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19478 if ( _5B65B4_npcdata_loword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19479 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19480 if ( _5B65B8_npcdata_hiword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19481 pParty->sRotationX = _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19482 if ( dword_5B65BC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19483 pParty->uFallSpeed = dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19485 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19486 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19487 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19488 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19489 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19490 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19491 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19494 // 5B65A8: using guessed type int _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19495 // 5B65AC: using guessed type int _5B65AC_npcdata_fame_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19496 // 5B65B0: using guessed type int _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19497 // 5B65B4: using guessed type int _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19498 // 5B65B8: using guessed type int _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19499 // 5B65BC: using guessed type int dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19500 // 5B65C0: using guessed type int dword_5B65C0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19501
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19502 //----- (00449A49) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19503 __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19504 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19505 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19506 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19507 signed int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19508 int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19509 BLVDoor *v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19510 unsigned int v7; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19511 signed int v8; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19512 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19513 char Args; // [sp+Ch] [bp-78h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19514
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19515 LOWORD(v2) = LOWORD(pIndoor->pDoors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19516 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19517 if ( !pIndoor->pDoors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19518 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19519 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19520 v5 = (int)&pIndoor->pDoors->uDoorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19521 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19523 if ( *(int *)v5 == uDoorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19524 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19525 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19526 v5 += 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19528 while ( v4 < 200 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19529 if ( v4 >= 200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19531 sprintfex(&Args, "Unable to find Door ID: %i!", uDoorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19532 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19534 v6 = &pIndoor->pDoors[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19535 if ( v3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19537 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19538 if ( (short)v2 == 3 || (short)v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19539 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19540 if ( (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19541 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19543 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19544 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19545 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19547 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19548 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19549 if ( (short)v2 && (short)v2 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19550 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
19551 v6->uState = BLVDoor::Closing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19552 if ( (short)v2 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19554 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19555 v6->uTimeSinceTriggered = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19556 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19558 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19559 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19560 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19562 v8 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19563 v9 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19564 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19565 v2 = (v6->uMoveLength << 7) / v8 - ((signed int)(v7 * v9) / 128 << 7) / v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19566 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19568 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19570 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19572 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19573 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19575 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19576 if ( (short)v2 != 2 && (short)v2 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19577 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
19578 v6->uState = BLVDoor::Opening;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19579 if ( !(short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19580 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19581 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19582 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19583 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19585 v8 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19586 v9 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19587 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19589 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19590 v6->uTimeSinceTriggered = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19591 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19592 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19594
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19595 //----- (00449B57) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19596 unsigned int __fastcall _449B57_test_bit(unsigned __int8 *a1, __int16 a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19598 return a1[(a2 - 1) >> 3] & (0x80u >> (a2 - 1) % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19601 //----- (00449B7E) --------------------------------------------------------
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19602 unsigned char *_449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19603 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19604 signed int v3; // esi@1
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19605 unsigned char *result; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19606 unsigned int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19607
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19608 v3 = a2 - 1;
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19609 result = &pArray[v3 / 8];
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19610 v5 = 0x80 >> v3 % 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19611 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19612 *result |= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19613 else
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19614 *result &= ~(unsigned char)v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19615 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19617
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19618
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19619 //----- (0044A56A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19620 void __cdecl sub_44A56A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19621 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19622 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19623 NPCData *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19624
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19625 pParty->field_70A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19626 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19627 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19629 v1 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19630 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19631 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19632 if ( v1->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v1->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19634 if ( !pParty->pHirelings[1].pName || strcmp(v1->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19635 ++pParty->field_70A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19637 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19638 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19640 while ( v0 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19643
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19644
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19645 //----- (0044C175) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19646 void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19648 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19649 int i; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19650
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19651 v2 = uNumSeconds;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19652 strcpy(GameUI_StatusBar_TimedString, pString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19653 GameUI_StatusBar_TimedStringTimeLeft = 1000 * v2 + GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19654 for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19655 i > 450;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19656 i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19657 byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19659
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19660 //----- (0044C1D0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19661 void __cdecl ShowNothingHereStatus()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19662 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19663 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19664 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19666
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19667
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19668 //----- (0044C28B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19669 signed int __cdecl const_2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19671 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19674 //----- (0044C28F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19675 bool __cdecl sub_44C28F_open_nwc_dungeon()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19677 bool result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19678
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19679 result = _strcmpi("nwc.blv", pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19680 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19682 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19683 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19684 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19685 _5B65B4_npcdata_loword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19686 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19687 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19688 dword_5B65C0 = 0;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19689 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19690 sub_44987B("nwc.blv", 0);
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
19691 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19692 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19694 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19695 }
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19696
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19697
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19698 //----- (0044C2F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19699 int LevelDecoration::IsInteractive()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19701 signed int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19702
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19703 v1 = this->uDecorationDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19704 if ( v1 > 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19706 if ( v1 == 184 || v1 == 187 || v1 == 190 || v1 > 205 && v1 <= 221 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19707 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19709 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19711 if ( v1 == 34 || v1 >= 4 && (v1 <= 6 || v1 == 11 || v1 > 12 && (v1 <= 14 || v1 == 24)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19712 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19714 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19716
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19717 //----- (0044C362) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19718 void Vec3_int_::Normalize_float()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19720 Vec3_int_ *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19721 double v2; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19722 float v3; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19723 double v4; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19724 float v5; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19725 double v6; // st4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19726 float v7; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19727 float v8; // ST24_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19728 float v9; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19729 double v10; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19730 float v11; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19731 double v12; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19732 float v13; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19733 double v14; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19734
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19735 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19736 v2 = (double)this->x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19737 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19738 v4 = (double)this->y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19739 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19740 v6 = (double)this->z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19741 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19742 v8 = 1.0 / sqrt(v6 * v6 + v4 * v4 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19743 v9 = v8 * v3 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19744 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19745 v1->x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19746 v11 = v8 * v5 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19747 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19748 v1->y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19749 v13 = v8 * v7 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19750 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19751 v1->z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19753
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19754 //----- (0044C448) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19755 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19757 GUIFont *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19758 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19759 const char **v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19760 unsigned int v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19761 unsigned __int16 **v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19762 GUIFont *v7; // [sp+4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19763 int v8; // [sp+8h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19764 unsigned __int16 **v9; // [sp+Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19765
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19766 result = (GUIFont *)pIcons_LOD->LoadRaw(pFontFile, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19767 v3 = pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19768 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19769 v7 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19770 if ( pFontPalette )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19772 v4 = &pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19773 v9 = result->pFontPalettes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19774 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19776 v5 = pIcons_LOD->LoadTexture(v3, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19777 if ( v5 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19778 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
19779 sprintf(pTmpBuf, "Unable to open %s", v3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19780 Abortf(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19782 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19783 v6 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19784 v3 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19785 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19786 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19787 *v6 = (v5 != -1 ? pIcons_LOD->pTextures[v5].pPalette16 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19789 while ( v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19790 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19791 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19792 result->field_8 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19793 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19795
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19796
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19797
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19798
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19799 //----- (0044C768) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19800 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19802 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19803 GUIFont *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19804 unsigned int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19805 int v9; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19806 unsigned __int8 v10; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19807 int v11; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19808 GUICharMetric *v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19809 int v13; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19810 int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19811 int v15; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19812 unsigned int v16; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19813 unsigned int v17; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19814 unsigned int v18; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19815 int v19; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19816 unsigned __int8 v20; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19817 char v21; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19818 unsigned __int8 v22; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19819 int v23; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19820 unsigned __int8 v24; // dl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19821 int v25; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19822 int v26; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19823 std::string v27; // [sp-18h] [bp-40h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19824 const char *v28; // [sp-8h] [bp-30h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19825 int v29; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19826 const char *v30; // [sp+Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19827 char Str[3]; // [sp+10h] [bp-18h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19828 char v32; // [sp+13h] [bp-15h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19829 size_t v33; // [sp+14h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19830 unsigned int v34; // [sp+18h] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19831 GUIFont *v35; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19832 int v36; // [sp+20h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19833 int v37; // [sp+24h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19835 v5 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19836 v6 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19837 v30 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19838 v35 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19839 if ( !pInString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19841 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19842 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19844 v33 = strlen(pInString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19845 strcpy(pTmpBuf3, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19846 v8 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19847 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19848 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19849 v34 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19850 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19851 if ( (signed int)v33 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19853 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19855 v10 = pTmpBuf3[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19856 if ((v10 < v6->cFirstChar || v10 > v6->cLastChar)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19857 && v10 != '\f' && v10 != '\r' && v10 != '\t' && v10 != '\n' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19858 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19859 v11 = v10 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19860 v12 = &v6->pMetrics[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19861 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19863 strncpy(Str, &pTmpBuf3[v9 + 1], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19864 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19865 v26 = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19866 v8 = uX + v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19867 v25 = v9 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19868 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19869 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19871 v13 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19872 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19873 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19874 v14 = v13 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19875 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19877 v25 = v9 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19878 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19879 v37 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19880 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19882 v15 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19883 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19885 if ( v15 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19886 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19887 v16 = v12->uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19888 v17 = v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19889 v18 = v12->uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19890 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19891 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19892 if ( v37 > v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19893 v8 += v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19894 v8 += v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19895 if ( v37 < (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19896 v8 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19897 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19898 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19899 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19901 v19 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19902 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19903 v22 = __OFSUB__(v36, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19904 v20 = v36 == v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19905 v21 = v36 - v37 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19906 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19907 pTmpBuf3[v36] = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19908 v23 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19909 if ( (unsigned __int8)(v21 ^ v22) | v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19911 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19913 v24 = pTmpBuf3[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19914 if ( v24 >= v6->cFirstChar && v24 <= v6->cLastChar || v24 == 12 || v24 == 13 || v24 == 9 || v24 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19916 if ( v23 > v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19917 v8 += v6->pMetrics[v24].uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19918 v8 += *((int *)&v6->cFirstChar + 3 * v24 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19919 if ( v23 < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19920 v8 += v6->pMetrics[v24].uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19922 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19924 while ( v23 <= v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19927 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19928 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19929 v8 += v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19930 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19932 if ( !a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19933 return (char *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19934 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19935 v9 = v37++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19936 if ( v37 >= (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19937 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19939 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19940 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19941 v36 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19942 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19944 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19946
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19947
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19948
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19949
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19950
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19951
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19952
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19953
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19954
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19955
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19956
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19957 //----- (00401000) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19958 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19959 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19960 void *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19961 int v5; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19962
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19963 if ( numObjs - 1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19965 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19966 v5 = numObjs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19967 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19969 constructor((int)v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19970 v4 = (char *)v4 + objSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19971 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19973 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19976
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19977
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19978 //----- (004014E6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19979 int __cdecl ODM_4014E6_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19981 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19982 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19983 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19984 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19985 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19986 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19987 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19988 unsigned int v7; // ST20_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19989 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19990 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19991 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19992 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19993 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19994 int result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19995 int v14; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19996 int v15; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19997 int v16; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19998 unsigned int *v17; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19999 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20000 int i; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20001 char *v20; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20002 int v21; // [sp+Ch] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20003 int v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20004 int v23; // [sp+14h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20005 int v24; // [sp+14h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20006 signed int v25; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20007 signed int v26; // [sp+18h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20008 int v27; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20009
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20010 pParty->uFlags &= 0xFFFFFFCFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20011 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20012 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20013 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20015 v0 = (int)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20016 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20018 *(char *)(v0 + 1) &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20019 if ( ! ((Actor *)(v0 - offsetof(Actor, uAttributes)))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20020 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20021 v22 = abs(pParty->vPosition.y - *(short *)(v0 + 110));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20022 v21 = abs(pParty->vPosition.z - *(short *)(v0 + 108));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20023 v1 = abs(pParty->vPosition.x - *(short *)(v0 + 106));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20024 v2 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20025 v3 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20026 if ( v1 < v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20028 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20029 v1 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20030 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20032 if ( v1 < v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20034 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20035 v1 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20036 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20038 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20039 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20040 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20041 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20042 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20044 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20045 v8 = *(short *)(v0 + 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20046 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20047 v23 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20048 if ( v23 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20050 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20051 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20052 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20053 if ( v9 < 5632 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20054 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20055 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20056 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20057 if ( v10 & 0x80000 || ((Actor *)(v0 - offsetof(Actor, uAttributes)))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20059 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20060 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20061 if ( v11 && (double)v23 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20062 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20063 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20064 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20066 *(char *)(v0 + 1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20067 v12 = v27++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20068 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20069 ai_array_4F7DB0_actor_ids[v12] = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20071 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20073 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20074 *(char *)(v0 + 1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20076 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20077 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20079 while ( v25 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20081 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20082 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20084 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20085 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20086 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20087 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20089 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20091 v24 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20092 if ( v15 >= result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20093 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20094 v16 = ai_array_4F75E0[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20095 if ( v16 > ai_array_4F75E0[v15] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20097 v17 = &ai_array_4F7DB0_actor_ids[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20098 v18 = ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20099 ai_array_4F7DB0_actor_ids[v14] = *v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20100 *v17 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20101 v15 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20102 ai_array_4F75E0[v14] = ai_array_4F75E0[v24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20103 ai_array_4F75E0[v24] = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20105 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20106 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20108 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20109 v15 = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20110 v26 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20112 while ( v15 - 1 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20114 ai_arrays_size = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20115 if ( result > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20117 result = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20118 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20120 for ( i = 0; i < result; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20122 v20 = (char *)&pActors[ai_array_4F7DB0_actor_ids[i]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20123 v20[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20125 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20126 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20127 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20129 //----- (004016FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20130 int __cdecl BLV_4016FA_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20131 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20132 char *v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20133 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20134 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20135 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20136 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20137 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20138 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20139 unsigned int v7; // ST24_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20140 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20141 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20142 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20143 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20144 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20145 int v13; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20146 int v14; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20147 int v15; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20148 unsigned int *v16; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20149 unsigned int v17; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20150 int v18; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20151 signed int v19; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20152 Actor *v20; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20153 bool v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20154 int v22; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20155 signed int v23; // ebx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20156 char *v24; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20157 signed int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20158 int v26; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20159 int v27; // ebx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20160 int j; // edi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20161 unsigned int v29; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20162 int v30; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20163 int v31; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20164 int v32; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20165 signed int v33; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20166 __int64 v34; // qax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20167 char *v35; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20168 int v37; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20169 int v38; // [sp+10h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20170 int v39; // [sp+14h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20171 int v40; // [sp+18h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20172 int v41; // [sp+18h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20173 int i; // [sp+18h] [bp-Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20174 signed int v43; // [sp+1Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20175 signed int v44; // [sp+1Ch] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20176 int v45; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20177
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20178 pParty->uFlags &= 0xFFFFFFCFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20179 v37 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.z, pParty->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20180 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20181 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20182 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20184 v0 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20185 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20187 v0[1] &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20188 if ( ! ((Actor *)(v0 - 36))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20189 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20190 v39 = abs(pParty->vPosition.y - *((short *)v0 + 55));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20191 v38 = abs(pParty->vPosition.z - *((short *)v0 + 54));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20192 v1 = abs(pParty->vPosition.x - *((short *)v0 + 53));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20193 v2 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20194 v3 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20195 if ( v1 < v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20196 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20197 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20198 v1 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20199 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20201 if ( v1 < v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20202 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20203 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20204 v1 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20205 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20207 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20209 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20210 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20211 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20213 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20214 v8 = *((short *)v0 + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20215 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20216 v40 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20217 if ( v40 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20219 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20220 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20221 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20222 if ( v9 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20223 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20224 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20225 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20226 if ( v10 & 0x80000 || ((Actor *)(v0 - 36))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20228 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20229 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20230 if ( v11 && (double)v40 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20231 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20232 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20233 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20235 v12 = v45++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20236 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20237 ai_array_4F7DB0_actor_ids[v12] = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20239 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20240 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20241 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20242 v0[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20243 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20244 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20245 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20247 while ( v43 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20249 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20250 if ( v45 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20252 v14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20253 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20254 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20256 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20258 v41 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20259 if ( v14 >= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20260 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20261 v15 = ai_array_4F75E0[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20262 if ( v15 > ai_array_4F75E0[v14] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20264 v16 = &ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20265 v17 = ai_array_4F7DB0_actor_ids[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20266 ai_array_4F7DB0_actor_ids[v13] = *v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20267 *v16 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20268 v14 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20269 ai_array_4F75E0[v13] = ai_array_4F75E0[v41];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20270 ai_array_4F75E0[v41] = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20272 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20273 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20274 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20275 v14 = v44 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20276 v44 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20278 while ( v14 - 1 < v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20279 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20280 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20281 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20282 for ( i = 0; v18 < v45; i = v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20284 v20 = &pActors[ai_array_4F7DB0_actor_ids[v18]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20285 if ( v20->uAttributes & 0x8000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20286 || (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
20287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20288 v22 = ai_array_4F7DB0_actor_ids[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20289 v20->uAttributes |= 0x8000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20290 ai_array_4F6638_actor_ids[v19] = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20291 ai_array_4F5E68[v19++] = ai_array_4F75E0[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20292 if ( v19 >= 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20293 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20295 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20297 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20298 ai_arrays_size = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20299 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20301 v24 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20302 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20304 if ( ((Actor *)(v24 - 36))->CanAct() && *((short *)v24 + 61) == v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20306 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20307 if ( v19 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20309 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20310 v26 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20311 v24[1] |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20312 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20313 ai_array_4F6638_actor_ids[v26] = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20315 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20317 while ( ai_array_4F6638_actor_ids[v25] != v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20319 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20320 if ( v25 >= v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20321 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20325 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20326 v24 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20327 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20328 while ( v23 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20329 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20330 v27 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20331 for ( j = 0; j < v45; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20333 v29 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20334 if ( pActors[v29].uAttributes & 0xC000 && pActors[v29].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20336 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20337 if ( v27 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20339 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20340 v31 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20341 v32 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20342 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20343 ai_array_4F6638_actor_ids[v31] = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20345 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20347 while ( ai_array_4F6638_actor_ids[v30] != ai_array_4F7DB0_actor_ids[j] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20349 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20350 if ( v30 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20351 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20354 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20355 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20356 v33 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20357 if ( ai_arrays_size > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20358 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20359 v33 = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20360 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20362 memcpy(ai_array_4F7DB0_actor_ids, ai_array_4F6638_actor_ids, 4 * v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20363 memcpy(ai_array_4F75E0, ai_array_4F5E68, 4 * ai_arrays_size);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20364 v34 = (unsigned int)ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20365 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20367 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20368 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20369 v35 = (char *)&pActors[ai_array_4F7DB0_actor_ids[HIDWORD(v34)]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20370 v35[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20371 ++HIDWORD(v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20373 while ( SHIDWORD(v34) < (signed int)v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20375 return v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20377 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20378
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20379 //----- (00401A91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20380 void __cdecl sub_401A91_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20382 unsigned int v0; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20383 int v1; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20384 int v2; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20385 int v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20386 signed int v4; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20387 char *v5; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20388 signed int v6; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20389 __int16 v7; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20390 Player **v8; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20391 Player *pPlayer; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20392 Actor *pActor; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20393 __int16 v11; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20394 unsigned int v12; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20395 signed int v13; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20396 SpellBuff *v14; // ebx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20397 unsigned int v15; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20398 char *v16; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20399 unsigned int v17; // edx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20400 unsigned int v18; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20401 unsigned __int16 v19; // ax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20402 int *v20; // esi@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20403 Actor *v21; // ebx@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20404 unsigned __int16 v22; // ax@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20405 signed int v23; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20406 unsigned int v24; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20407 signed int v25; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20408 SpellBuff *v26; // esi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20409 unsigned int v27; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20410 unsigned int v28; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20411 unsigned int v29; // eax@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20412 AIDirection *v30; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20413 unsigned __int16 v31; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20414 unsigned int v32; // esi@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20415 int v33; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20416 int v34; // eax@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20417 char v35; // al@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20418 unsigned int v36; // edi@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20419 signed int v37; // eax@154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20420 unsigned __int8 v38; // sf@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20421 unsigned __int8 v39; // of@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20422 signed int v40; // edx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20423 unsigned int v41; // ecx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20424 double v42; // st7@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20425 double v43; // st6@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20426 bool v44; // eax@189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20427 bool v45; // eax@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20428 unsigned __int8 v46; // cl@197
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20429 double v47; // st7@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20430 double v48; // st7@207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20431 char v49; // zf@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20432 char v50; // zf@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20433 signed int v51; // edx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20434 unsigned int v52; // ecx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20435 __int16 v53; // fps@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20436 unsigned __int8 v54; // c0@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20437 unsigned __int8 v55; // c3@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20438 double v56; // st7@226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20439 AIDirection *v57; // eax@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20440 double v58; // st7@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20441 signed int v59; // [sp-18h] [bp-C8h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20442 int v60; // [sp-14h] [bp-C4h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20443 int v61; // [sp-14h] [bp-C4h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20444 AIDirection *v62; // [sp-14h] [bp-C4h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20445 signed int v63; // [sp-14h] [bp-C4h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20446 unsigned int v64; // [sp-14h] [bp-C4h]@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20447 unsigned int v65; // [sp-10h] [bp-C0h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20448 char v66; // [sp-10h] [bp-C0h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20449 AIDirection *v67; // [sp-10h] [bp-C0h]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20450 int v68; // [sp-10h] [bp-C0h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20451 AIDirection *v69; // [sp-10h] [bp-C0h]@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20452 int v70; // [sp-10h] [bp-C0h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20453 AIDirection *v71; // [sp-10h] [bp-C0h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20454 AIDirection v72; // [sp+0h] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20455 AIDirection a3; // [sp+1Ch] [bp-94h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20456 AIDirection v74; // [sp+38h] [bp-78h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20457 AIDirection v75; // [sp+54h] [bp-5Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20458 int v76; // [sp+70h] [bp-40h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20459 signed int a1; // [sp+74h] [bp-3Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20460 int v78; // [sp+78h] [bp-38h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20461 AIDirection pDir; // [sp+7Ch] [bp-34h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20462 float v80; // [sp+98h] [bp-18h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20463 int v81; // [sp+9Ch] [bp-14h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20464 int v82; // [sp+A0h] [bp-10h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20465 unsigned int uActorID; // [sp+A4h] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20466 unsigned int v84; // [sp+A8h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20467 signed int a2; // [sp+ACh] [bp-4h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20468
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20469 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20470 ODM_4014E6_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20471 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20472 BLV_4016FA_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20473 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20474 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor && pParty->field_1613C > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20476 if ( pParty->field_1613C > 417 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20478 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20479 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20480 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20482 pParty->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (pParty->sRotationY + rand() % 16 - 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20483 v1 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20484 v2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20485 v3 = pParty->sRotationX + v1 % 16 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20486 pParty->sRotationX = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20487 if ( v3 > 128 || (v2 = -128, v3 < -128) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20488 pParty->sRotationX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20489 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20490 pParty->field_1613C -= pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20491 v4 = pParty->field_16140 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20492 if ( pParty->field_1613C <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20494 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20495 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20496 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20498 v5 = (char *)&pActors[0].sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20499 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20501 if ( ((Actor *)(v5 - 40))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20503 v6 = stru_50C198.CalcMagicalDamageToActor((Actor *)(v5 - 40), 5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20504 v7 = *(short *)v5 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20505 *(short *)v5 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20506 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20508 if ( v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20510 Actor::_4030AD(v84, 4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20511 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20512 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20514 Actor::Die(v84);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20515 if ( *((int *)v5 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20516 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[*((short *)v5 + 28)].uExp);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20520 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20521 v5 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20523 while ( (signed int)v84 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20525 v8 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20526 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20528 pPlayer = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20529 if ( !(*v8)->pConditions[14] && !pPlayer->pConditions[15] && !pPlayer->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20530 pPlayer->ReceiveDamage(v4, 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20531 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20533 while ( (signed int)v8 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20534 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20536 if ( pTurnEngine->field_1C != v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20537 --pTurnEngine->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20539 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20540 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20542 pTurnEngine->_405E14();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20543 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20545 uActorID = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20546 if ( (signed int)uNumActors > (signed int)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20548 LODWORD(v80) = (int)(char *)pActors + 176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20549 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20551 pActor = (Actor *)(LODWORD(v80) - 176);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20552 v11 = *(unsigned int *)LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20553 v49 = *(unsigned int *)LODWORD(v80) == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20554 dword_4F6E08[uActorID] = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20555 if ( v49 || v11 == 11 || v11 == 19 || *(char *)(LODWORD(v80) - 139) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20556 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20557 if ( !*(short *)(LODWORD(v80) - 136) && v11 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20558 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20559 v84 = *(_QWORD *)(LODWORD(v80) + 84) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20560 v82 = *(_QWORD *)(LODWORD(v80) + 52) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20561 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20562 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20563 v14 = (SpellBuff *)(LODWORD(v80) + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20564 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20566 if ( v13 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20568 v14->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20569 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20571 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20572 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20574 while ( v13 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20575 if ( v84 != v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20576 && SHIDWORD(pActor->pActorBuffs[3].uExpireTime) <= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20577 && (SHIDWORD(pActor->pActorBuffs[3].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20578 || LODWORD(pActor->pActorBuffs[3].uExpireTime) <= v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20579 pActor->uActorHeight = pMonsterList->pMonsters[pActor->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20580 if ( v82 != v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20581 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20582 pActor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20583 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) <= (signed int)v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20584 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20585 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20586 || LODWORD(pActor->pActorBuffs[1].uExpireTime) <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20587 pActor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].uHostilityType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20590 if ( SHIDWORD(pActor->pActorBuffs[5].uExpireTime) > (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20591 || SHIDWORD(pActor->pActorBuffs[5].uExpireTime) >= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20592 && LODWORD(pActor->pActorBuffs[5].uExpireTime)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20593 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) > 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20594 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) >= 0 && LODWORD(pActor->pActorBuffs[6].uExpireTime) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20595 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20596 v15 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20597 v16 = (char *)&pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20598 pActor->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20599 v17 = pActor->uCurrentActionTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20600 v18 = pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20601 if ( (signed int)v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20602 *(int *)v16 = v18 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20603 if ( *(int *)v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20604 *(int *)v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20605 if ( (signed int)v17 < pActor->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20606 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20607 v19 = pActor->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20608 if ( v19 == Dying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20610 pActor->uAIState = Dead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20612 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20614 if ( v19 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20616 Actor::_403F58(uActorID, Dying, 256, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20617 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20619 pActor->uAIState = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20621 pActor->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20622 pActor->uCurrentActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20623 pActor->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20624 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20625 ++uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20626 LODWORD(v80) += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20628 while ( (signed int)uActorID < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20630 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20631 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20633 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20635 uActorID = ai_array_4F7DB0_actor_ids[v78];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20636 v20 = &dword_4F6E08[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20637 v21 = &pActors[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20638 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20639 if ( v21->pMonsterInfo.uHostilityType && !*v20 )
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20640 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20641 a2 = *v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20642 v76 = a2 & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20643 if ( (a2 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20644 v80 = 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20645 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20646 v80 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20647 v22 = v21->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20648 if ( v22 == 4 || v22 == 5 || v22 == 11 || v22 == 19 || v22 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20649 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20650 if ( !v21->sCurrentHP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20651 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20652 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20654 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20655 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20657 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20659 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20660 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20662 if ( (signed __int64)v21->pActorBuffs[1].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20663 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20664 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20665 v82 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20666 if ( (signed __int64)v21->pActorBuffs[2].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20667 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20668 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20669 v81 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20670 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20671 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20672 v26 = v21->pActorBuffs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20673 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20675 if ( v25 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20677 v26->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20678 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20680 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20681 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20683 while ( v25 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20684 if ( v84 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20685 && SHIDWORD(v21->pActorBuffs[3].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20686 && (SHIDWORD(v21->pActorBuffs[3].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20687 || LODWORD(v21->pActorBuffs[3].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20688 v21->uActorHeight = pMonsterList->pMonsters[v21->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20689 if ( v82 != v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20690 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20691 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20692 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) <= (signed int)v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20693 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20694 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20695 || LODWORD(v21->pActorBuffs[1].uExpireTime) <= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20696 v21->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[v21->pMonsterInfo.uID].uHostilityType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20699 if ( v81 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20700 && SHIDWORD(v21->pActorBuffs[2].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20701 && (SHIDWORD(v21->pActorBuffs[2].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20702 || LODWORD(v21->pActorBuffs[2].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20704 v21->uAIState = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20705 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20707 if ( v21->pActorBuffs[5].uExpireTime || v21->pActorBuffs[6].uExpireTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20708 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20709 v27 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20710 v28 = v21->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20711 v21->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20712 if ( (signed int)v28 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20713 v21->pMonsterInfo.uRecoveryTime = v28 - v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20714 if ( (v21->pMonsterInfo.uRecoveryTime & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20715 v21->pMonsterInfo.uRecoveryTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20716 v29 = v21->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20717 if ( !(v29 & 0x8000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20718 v21->uAttributes = v29 | 0x8000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20719 a1 = 8 * uActorID | 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20720 v30 = Actor::GetDirectionInfo(8 * uActorID | 3, a2, &a3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20721 v49 = v21->pMonsterInfo.uHostilityType == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20722 memcpy(&v75, v30, sizeof(v75));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20723 memcpy(&pDir, &v75, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20724 if ( !v49 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20726 if ( v80 * 307.2 >= (double)(signed int)v75.uDistance
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20727 && ((v31 = v21->uAIState, v31 == 6) || !v31 || v31 == 1 || v31 == 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20728 || v21->pMonsterInfo.uMissleAttack1Type && v21->uAIState == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20730 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20731 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20734 if ( (signed int)v21->uCurrentActionTime < v21->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20735 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20736 if ( v21->uAIState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20738 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20739 v35 = stru_50C198.special_ability_use_check(v21, uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20740 stru_50FE08.Add(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20741 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20742 5120,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20743 v21->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20744 v21->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20745 v21->vPosition.z + ((signed int)v21->uActorHeight >> 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20746 v35,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20747 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20748 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20750 if ( v21->uAIState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20752 v34 = v21->pMonsterInfo.uMissleAttack1Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20753 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20754 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20756 if ( v21->uAIState == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20758 v34 = v21->pMonsterInfo.uMissleAttack2Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20759 v66 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20760 LABEL_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20761 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20762 Actor::_404874(uActorID, &pDir, v34, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20763 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20765 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20766 if ( v21->uAIState == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20767 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20768 if ( v21->uAIState == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20769 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20770 v65 = v21->pMonsterInfo.uSpellSkillAndMastery2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20771 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20772 v33 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20773 LABEL_146:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20774 Actor::_404AC7(uActorID, &pDir, v33, v60, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20776 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20777 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20778 if ( v21->pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20779 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20780 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20782 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20783 v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (v21->pMonsterInfo.uID - 1) / 3]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20784 + (pActors[a2 >> 3].pMonsterInfo.uID - 1) / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20786 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20788 v37 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20790 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20791 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20792 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20794 v39 = __OFSUB__(v36, 1024);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20795 v38 = ((v36 - 1024) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20797 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20799 if ( v37 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20801 v39 = __OFSUB__(v36, 2560);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20802 v38 = ((v36 - 2560) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20804 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20806 if ( v37 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20807 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20808 v39 = __OFSUB__(v36, 5120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20809 v38 = ((v36 - 5120) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20812 if ( v38 ^ v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20813 LABEL_257:
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20814 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20815 LABEL_165:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20816 if ( (signed __int64)v21->pActorBuffs[4].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20818 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20819 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20820 if ( (signed int)v36 >= 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20822 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20823 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20824 goto LABEL_253;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20826 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20827 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20829 if ( v21->pMonsterInfo.uHostilityType != 4 || !a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20830 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20831 if ( !(v21->uAttributes & 0x020000) || v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20833 if ( v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20835 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20836 if ( v21->pMonsterInfo.uMovementType != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20837 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20838 Actor::_403EB6(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20839 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20840 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20841 (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20842 &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20844 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20846 if ( v21->pMonsterInfo.uAIType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20847 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20848 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20849 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20850 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20852 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20854 if ( v21->pMonsterInfo.uAIType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20855 goto LABEL_185;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20856 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20857 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20858 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20860 if ( v43 > v42 && (signed int)v36 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20862 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20863 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20864 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20865 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20866 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20867 Actor::_402968(v41, v40, 0, v67);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20868 goto LABEL_254;
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 LABEL_185:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20873 v81 = v36 - v21->uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20874 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20875 v81 -= pActors[a2 >> 3].uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20876 if ( v81 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20877 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20878 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20879 v44 = (signed int)v21->pMonsterInfo.uRecoveryTime <= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20880 v21->uAttributes &= 0xFBFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20881 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20882 v49 = v21->pMonsterInfo.uMovementType == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20883 v84 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20884 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20885 v82 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20886 if ( v81 >= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20887 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20888 v45 = stru_50C198.special_ability_use_check(v21, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20889 if ( !v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20891 if ( v21->pMonsterInfo.uMissleAttack1Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20892 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20893 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20894 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20895 Actor::_403476(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20896 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20898 LABEL_223:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20899 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20900 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20901 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20902 //UNDEF(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20903 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20904 if ( !(v54 | v55) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20905 goto LABEL_219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20906 LABEL_225:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20907 Actor::_402AD7(v32, a2, v32, (signed __int64)v47, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20908 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20910 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20911 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20913 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20915 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20916 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20917 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20918 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20919 goto LABEL_240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20921 goto LABEL_235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20923 goto LABEL_227;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20925 if ( v45 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20927 if ( v45 > 1 && v45 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20929 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20930 v46 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20931 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20932 v46 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20933 if ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20935 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20937 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20938 Actor::_403854(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20939 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20940 Actor::_403A60(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20941 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20943 if ( v80 * 307.2 > (double)v81 || v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20944 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20945 LABEL_217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20946 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20947 LABEL_218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20948 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20949 LABEL_219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20950 v51 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20951 v64 = (signed __int64)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20952 v52 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20953 LABEL_247:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20954 Actor::_403EB6(v52, v51, v64, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20955 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20957 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20958 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20959 goto LABEL_225;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20961 v48 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20962 if ( (double)v81 >= v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20964 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20966 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20967 LABEL_215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20968 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20969 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20970 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20971 v63 = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20972 LABEL_240:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20973 Actor::_402686(v32, a2, v63, v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20974 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20975 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20976 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20977 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20978 v70 = (signed __int64)v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20979 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20980 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20981 goto LABEL_237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20982 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20983 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20984 goto LABEL_209;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20986 LABEL_241:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20987 if ( !v21->pMonsterInfo.uMovementType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20989 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20990 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20991 LABEL_252:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20992 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20993 v40 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20994 LABEL_253:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20995 Actor::_4032B2(v41, v40, v61, v68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20996 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20998 if ( v21->pMonsterInfo.uMovementType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21000 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21001 v61 = 2560;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21002 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21004 if ( v21->pMonsterInfo.uMovementType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21006 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21007 v61 = 5120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21008 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21010 if ( v21->pMonsterInfo.uMovementType == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21011 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21012 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21013 v61 = 10240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21014 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21016 if ( v21->pMonsterInfo.uMovementType == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21018 v57 = Actor::GetDirectionInfo(a1, 4u, &v72, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21019 v58 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21020 memcpy(&v74, v57, sizeof(v74));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21021 memcpy(&pDir, &v74, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21022 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21023 v52 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21024 v64 = (signed __int64)v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21025 v51 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21026 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21028 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21030 if ( !v21->pMonsterInfo.uMissleAttack2Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21032 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21033 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21035 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21037 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21038 goto LABEL_215;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21040 LABEL_235:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21041 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21042 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21043 v70 = (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21044 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21045 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21046 LABEL_237:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21047 Actor::_40281C(v32, a2, v59, v62, v70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21048 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21050 LABEL_227:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21051 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21052 LABEL_209:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21053 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21054 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21055 goto LABEL_218;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21056 Actor::_403C6C(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21057 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21059 if ( !v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21060 goto LABEL_223;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21061 Actor::_40368B(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21062 LABEL_254:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21063 ++v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21064 if ( v78 >= ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21065 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21066 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21067 v65 = v21->pMonsterInfo.uSpellSkillAndMastery1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21068 v60 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21069 v33 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21070 goto LABEL_146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21073
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21075
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21076
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21077 //----- (0040261D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21078 int stru298::Add(__int16 uID, __int16 a3, __int16 x, __int16 y, __int16 z, char a7, char a8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21080 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21081
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21082 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21083 if ( this->count < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21085 this->pIDs[result] = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21086 this->pXs[this->count] = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21087 this->pYs[this->count] = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21088 this->pZs[this->count] = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21089 this->field_324[this->count] = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21090 this->field_3EC[this->count] = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21091 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21092 this->field_450[this->count++] = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21094 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21097
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21098
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21099
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21101 //----- (00402CAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21102 int stru193_math::SinCos(int angle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21104 unsigned int v2; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21105 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21106 int result; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21108 v2 = this->uIntegerPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21109 v3 = this->uDoublePiMask & angle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21110 if ( (signed int)v3 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21111 v3 = this->uIntegerDoublePi - v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21112 if ( (signed int)v3 >= (signed int)this->uIntegerHalfPi )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21113 result = -this->pCosTable[v2 - v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21114 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21115 result = this->pCosTable[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21116 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21117 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21122
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21132 //----- (00404544) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21133 signed int stru262_TurnBased::_404544()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21134 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21135 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21136 TurnBased_QueueElem *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21137 Actor *v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21138 Actor *v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21139 Player *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21140 int v6; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21141 TurnBased_QueueElem *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21142 TurnBased_QueueElem *v8; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21143 int v9; // edx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21144 int v10; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21145 int v11; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21146 int v12; // ST0C_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21147 int v13; // ST10_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21148 int v14; // ST14_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21149 int v15; // ST18_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21150 signed int result; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21151 TurnBased_QueueElem *v17; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21152 int v18; // [sp+20h] [bp-Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21153 int v19; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21154 int v20; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21155 signed int v21; // [sp+28h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21156 int v22; // [sp+28h] [bp-4h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21158 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21159 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21160 v19 = this->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21161 if ( this->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21163 v2 = this->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21164 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21166 if ( (v2->uPackedID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21168 v3 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21169 v4 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21170 LOBYTE(v4->uAttributes) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21171 if ( !v4->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21172 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21173 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21174 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21175 LOBYTE(v3->uAttributes) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21178 if ( (v2->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21180 v5 = &pParty->pPlayers[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21181 if ( v5->pConditions[14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21182 || v5->pConditions[16]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21183 || v5->pConditions[15]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21184 || v5->pConditions[13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21185 || v5->pConditions[12]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21186 || v5->pConditions[2] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21188 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21189 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21192 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21193 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21195 while ( v20 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21197 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21198 if ( v6 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21200 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21201 v7 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21202 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21204 v18 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21205 if ( v21 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21207 v8 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21208 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21210 v9 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21211 v10 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21212 if ( v9 < v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21213 || v9 == v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21214 && ((v11 = v8->uPackedID & 7, v11 == 4) && (v7->uPackedID & 7) == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21215 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21217 v12 = v7->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21218 v13 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21219 v14 = v7->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21220 v15 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21221 v7->uPackedID = v8->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21222 v7->field_4 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21223 v7->uActionLength = v8->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21224 v7->field_C = v8->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21225 v8->uPackedID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21226 v8->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21227 v8->uActionLength = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21228 v8->field_C = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21229 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21230 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21231 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21233 while ( v18 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21235 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21236 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21237 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21239 while ( v21 - 1 < v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21240 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21241 v1->uActorQueueSize = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21242 result = v1->pQueue[0].uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21243 if ( (v1->pQueue[0].uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21245 result = (result >> 3) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21246 uActiveCharacter = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21247 v1->field_18 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21249 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21251 uActiveCharacter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21252 v1->field_18 &= 0xFFFFFFFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21254 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21255 if ( v1->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21257 v17 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21258 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21259 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21260 if ( (v17->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21261 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21262 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21263 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21264 result = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21266 while ( v22 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21267 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21268 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21270
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21271 //----- (0040471C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21272 int stru262_TurnBased::_40471C()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21274 int result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21275
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21276 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21278 if ( pTurnEngine->field_4 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21279 result = _406457(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21281 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21285 //----- (00404828) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21286 LayingItem::LayingItem()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21287 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21288 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21290 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21291 v1->field_22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21292 v1->uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21293 v1->uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21294 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21295 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21296 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21297 v1->uItemType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21298 v1->uObjectDescID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21299 v1->field_61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21300 v1->field_60_distance_related_prolly_lod = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21301 v1->field_20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21302 v1->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21303 v1->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21304 v1->field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21305 v1->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21306 v1->field_54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21307 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21308
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21310
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21311 //----- (004059DB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21312 signed int stru262_TurnBased::Start()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21314 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21315 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21316 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21317 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21318 unsigned int v5; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21319 Actor *v6; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21320 unsigned int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21321 unsigned int v8; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21322 unsigned __int8 v9; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21323 unsigned __int8 v10; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21324 unsigned __int8 v11; // of@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21325 char *v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21326 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21327 unsigned __int16 v14; // ax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21328 int v15; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21329 signed __int64 v16; // qax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21330 int v17; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21331 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21332 char *v19; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21333 int v20; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21334 char *v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21335 int v22; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21336 int v23; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21337 char *v24; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21338 char *v25; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21339 int v26; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21340 int v27; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21341 int v28; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21342 AIDirection v30; // [sp+Ch] [bp-68h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21343 AIDirection v31; // [sp+28h] [bp-4Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21344 AIDirection a3; // [sp+44h] [bp-30h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21345 int v33; // [sp+60h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21346 int *v34; // [sp+64h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21347 int v35; // [sp+68h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21348 int v40; // [sp+6Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21349 unsigned int v37; // [sp+70h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21350
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21351 pTurnEngine->field_18 &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21352 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21353 pEventTimer->TrackGameTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21354 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21355 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21356 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21357 v40 = (int)pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21358 dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21359 dword_50C994 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21360 v1->field_10 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21361 v1->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21362 v1->field_8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21363 v1->field_4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21364 v1->uActorQueueSize = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21365 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21366 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21367 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21368 if ( ((Player *)v40)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21370 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = 8 * v3 | OBJECT_Player;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21371 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21372 v1->pQueue[v1->uActorQueueSize].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21373 pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21375 v40 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21376 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21378 while ( v40 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21379 v35 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21380 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21381 v40 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21382 if ( v40 < v40 + ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21384 v34 = (int *)ai_array_4F7DB0_actor_ids;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21385 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21387 v37 = *v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21388 v5 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21389 v6 = &pActors[v37];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21390 if ( v37 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21391 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21392 if ( pActors[v37].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21393 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21394 v7 = v6->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21395 if ( v7 & 0x8000 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21396 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21397 v8 = dword_4F6E08[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21398 LOBYTE(v7) = v7 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21399 v6->uAttributes = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21400 v33 = 8 * v5 | OBJECT_Actor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21401 memcpy(&v31, Actor::GetDirectionInfo(8 * v5 | OBJECT_Actor, v8, &a3, 0), sizeof(v31));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21402 memcpy(&v30, &v31, sizeof(v30));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21403 Actor::_403F58(v37, 4, 32, &v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21404 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21405 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21406 v1->pQueue[v1->uActorQueueSize++].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21408 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21409 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21411 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21412 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21414 while ( v40 < v4 + ai_arrays_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21415 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21416 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21417 v11 = __OFSUB__(v1->uActorQueueSize, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21418 v9 = v1->uActorQueueSize == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21419 v10 = ((v1->uActorQueueSize - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21420 v37 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21421 v40 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21422 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21423 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21424 v12 = (char *)&v1->pQueue[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21425 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21427 v13 = *((int *)v12 - 1) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21428 if ( v13 != OBJECT_Player )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21429 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21430 v14 = pPlayers[(*((int *)v12 - 1) >> 3) + 1]->uTimeToRecovery;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21431 if ( v14 != (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21433 v33 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21434 v16 = (signed __int64)((double)v14 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21435 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21436 *(int *)v12 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21437 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21439 v15 = v37++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21440 *(&a3.uDistance + v15) = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21441 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21442 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21443 v12 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21444 if ( v40 >= v1->uActorQueueSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21445 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21446 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21447 if ( v13 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21449 *(int *)v12 = 666;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21450 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21452 v17 = rand() % 99;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21453 if ( v17 < 33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21455 *(int *)v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21456 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21458 LODWORD(v16) = SHIDWORD(v16) < 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21459 LOBYTE(v16) = SHIDWORD(v16) >= 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21460 LODWORD(v16) = 2 * v16 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21461 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21463 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21464 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21465 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21466 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21467 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21469 *(&v31.uDistance + v18) = pParty->pPlayers[*(&v1->field_0 + 4 * (*(&a3.uDistance + v18) + 2)) >> 3].GetAttackRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21470 v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21471 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21473 while ( (signed int)v18 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21474 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21476 v35 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21477 v34 = (int *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21478 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21479 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21480 v40 = (int)v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21481 if ( (signed int)v34 < (signed int)v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21483 v19 = (char *)&v31.uDistance + v35;
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 v20 = *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21487 v33 = 4 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21488 v21 = (char *)(&v31.uDistance + v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21489 v22 = *(int *)v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21490 if ( *(int *)v21 < v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21492 *(int *)v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21493 v23 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21494 *(int *)v19 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21495 v24 = (char *)&a3.uDistance + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21496 v25 = (char *)&a3.uDistance + v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21497 v26 = *(int *)v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21498 *(int *)v24 = *(unsigned int *)((char *)&a3.uDistance + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21499 *(int *)v25 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21500 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21502 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21504 while ( v40 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21506 v34 = (int *)((char *)v34 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21507 v35 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21509 while ( (signed int)((char *)v34 - 1) < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21510 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21512 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21514 v27 = v2 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21515 v28 = *(&a3.uDistance + v2++);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21516 v11 = __OFSUB__(v2, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21517 v10 = ((v2 - v37) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21518 v1->pQueue[v28].field_4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21519 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21520 while ( v10 ^ v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21524 return v1->_404544();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21526