annotate mm7_3.cpp @ 76:75994455e457

BLV collisions
author Nomad
date Sat, 27 Oct 2012 22:25:38 +0200
parents 8453114181af
children 8b0c4d626477
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;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
125 v32 = v9->uNumFloors + v9->field_C + v9->field_14;
0
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;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
349 v7 = v4->uAttributes;
0
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) --------------------------------------------------------
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
521 int _46ED1B_collide_against_floor(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID)
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
522 {
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
523 uint uFaceID = -1;
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
524 int floor_level = _46CEC3_get_floor_level(x, y, z, *pSectorID, &uFaceID);
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
525
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
526 if (floor_level != -30000 && floor_level <= z + 50)
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
527 {
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
528 *pFaceID = uFaceID;
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
529 return floor_level;
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
530 }
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
531
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
532 uint uSectorID = pIndoor->GetSector(x, y, z);
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
533 *pSectorID = uSectorID;
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
534
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
535 floor_level = _46CEC3_get_floor_level(x, y, z, uSectorID, &uFaceID);
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
536 if (uSectorID && floor_level != -30000)
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
537 *pFaceID = uFaceID;
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
538 else return -30000;
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
539 return floor_level;
0
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 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
652 if ( stru_721530.sMaxY <= pParty->vPosition.y + v1 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
653 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
654 if ( stru_721530.sMinY >= pParty->vPosition.y - v1 )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
655 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
656 if ( stru_721530.sMaxZ <= (signed int)(pParty->vPosition.z + pParty->uPartyHeight) )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
657 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
658 if ( stru_721530.sMinZ >= pParty->vPosition.z )
0
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
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
663 - (pParty->vPosition.y - stru_721530.normal.y) * stru_721530.field_58.x) >> 16;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
664 v10 = pParty->vPosition.y - stru_721530.normal.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 result = abs(((pParty->vPosition.x - stru_721530.normal.x) * stru_721530.field_58.y
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
666 - (pParty->vPosition.y - stru_721530.normal.y) * stru_721530.field_58.x) >> 16);
0
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;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
674 result = pParty->vPosition.z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
675 if ( v6 >= pParty->vPosition.z )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
677 result = v9 + pParty->vPosition.z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
678 if ( v6 <= (signed int)(v9 + pParty->vPosition.z) || v8 )
0
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 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1014 v0->uAIState = Removed;
0
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();
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1117 v0->uAIState = Stunned;
0
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);
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1194 v0->uAIState = Removed;
0
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];
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
1277 if ( !(BYTE3(v41->uAttributes) & 0x20) )
0
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;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1375 v0->uAIState = Fleeing;
0
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 //----- (0047136C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 void LayingItem::UpdateObject_fn0_BLV(unsigned int uLayingItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 ObjectDesc *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 int v3; // ST08_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 __int16 v4; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 __int16 v5; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 BLVFace *v6; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 BLVFace *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 signed int v8; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 int v9; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 __int16 v10; // di@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 char v11; // al@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 int v12; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 int v13; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 int v14; // ebx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 signed int v15; // ebx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 BLVFace *v16; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 int v17; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 int v18; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 int v19; // ecx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 Vec3_short_ *v20; // ecx@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 int v21; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 __int16 v22; // ax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 int v23; // edi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 int v24; // edi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 int v25; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 unsigned __int64 v26; // qax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 unsigned __int8 v27; // sf@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 unsigned __int8 v28; // of@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 __int16 v29; // di@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 char v30; // al@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 const char *v31; // [sp-8h] [bp-98h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 const char *v32; // [sp-8h] [bp-98h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 enum TEXTURE_TYPE v33; // [sp-4h] [bp-94h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 enum TEXTURE_TYPE v34; // [sp-4h] [bp-94h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 Particle_ Dst; // [sp+Ch] [bp-84h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 unsigned int uLayingItemID_; // [sp+74h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 ObjectDesc *v37; // [sp+78h] [bp-18h]@1
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
1427 unsigned int uFaceID; // [sp+7Ch] [bp-14h]@4
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 int v39; // [sp+80h] [bp-10h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 int v40; // [sp+84h] [bp-Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 int v41; // [sp+88h] [bp-8h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 int v42; // [sp+8Ch] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 uLayingItemID_ = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 v1 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 v2 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 v3 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 v37 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 if ( abs(v3) > 32767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 || abs(v1->vPosition.y) > 32767
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 || abs(v1->vPosition.z) > 20000
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
1441 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v1->uSectorID, &uFaceID),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 v42 <= -30000)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 && ((v4 = pIndoor->GetSector(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 (v1->uSectorID = v4) == 0)
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
1445 || (v42 = _46CEC3_get_floor_level(v1->vPosition.x, v1->vPosition.y, v1->vPosition.z, v4, &uFaceID), v42 == -30000)) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 v5 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 if ( v5 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 stru_721530.field_0 = v8;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
1457 uFaceID = v8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 stru_721530.prolly_normal_d = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 v12 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461 stru_721530.field_C = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 stru_721530.field_8 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 stru_721530.field_70 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466 stru_721530.field_34.x = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 stru_721530.field_34.y = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 stru_721530.normal.y = stru_721530.field_34.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 stru_721530.field_34.z = stru_721530.prolly_normal_d + v1->vPosition.z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 stru_721530.normal.z = stru_721530.field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 stru_721530.field_1C = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 stru_721530.field_20 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 stru_721530.field_24 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475 stru_721530.uSectorID = v1->uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 if ( stru_721530._47050A(v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 v40 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481 _46E44E_collide_against_faces_and_portals(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 _46E0B2_collide_against_decorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 if ( (v1->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 _46EF01_collision_chech_player(1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 v13 = v1->field_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486 v42 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 if ( (v13 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 if ( (signed int)uNumActors > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491 v39 = (int)&pActors[0].word_000086_some_monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 v41 = pActors[v1->field_58 >> 3].pMonsterInfo.uID - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 v14 = (signed __int64)((double)v41 * 0.3333333333333333);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 v41 = *(short *)(v39 - 38) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 _46DF1A_collide_against_actor(v42, *((short *)&pMonsterList->pMonsters[*(short *)v39] - 73));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 ++v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 v39 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 while ( v42 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 if ( (signed int)uNumActors > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 v39 = (int)&pActors[0].word_000086_some_monster_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 _46DF1A_collide_against_actor(v42++, *((short *)&pMonsterList->pMonsters[*(short *)v39] - 73));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 v39 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 while ( v42 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 while ( v40 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 v1->vPosition.x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 v1->vPosition.y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 memset(&Dst, v8, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 v29 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 if ( v29 & 0x200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 Dst.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 v30 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 v34 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 v32 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 if ( v29 & 0x400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 v30 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 v34 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 v32 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1558 Dst.timeToLive = (unsigned __int8)(v30 & 0x80) + 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v32, v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 if ( v2->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 v15 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 v40 = sub_452A9E(v1->vVelocity.x * v1->vVelocity.x + v1->vVelocity.y * v1->vVelocity.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 v23 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 v1->vPosition.x - pLevelDecorations[v15].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 v1->vPosition.y - pLevelDecorations[v15].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 v42 = stru_5C6E00->SinCos(v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 v41 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 v24 = v23 - stru_5C6E00->uIntegerHalfPi;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 v1->vVelocity.x = (unsigned int)(v42 * v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 v25 = stru_5C6E00->SinCos(v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 v42 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585 v26 = v25 * (signed __int64)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 v41 = v26 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 v1->vVelocity.y = WORD1(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 if ( (stru_721530.uFaceID & 7) != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 stru_721530.field_84 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 v16 = &pIndoor->pFaces[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 if ( v16->uPolygonType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 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
1598 + v16->pFacePlane_old.vNormal.y * v1->vVelocity.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 if ( stru_721530.field_64 >> 3 > v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 v42 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 v40 = v16->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 v40 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603 v41 = v16->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 v41 = (unsigned __int64)(v42 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 v39 = v16->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 v39 = (unsigned __int64)(v42 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 v1->vVelocity.x += 2 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 v1->vVelocity.y += 2 * v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 if ( v16->pFacePlane_old.vNormal.z <= 32000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 v22 = 2 * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 v21 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 v40 = 32000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 v1->vVelocity.z += v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 v41 = (unsigned __int64)(v40 * (signed __int64)v21) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 v22 = (unsigned int)(v40 * v21) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 v1->vVelocity.z += v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 if ( v37->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 v17 = -v1->vVelocity.z >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 v1->vVelocity.z = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 if ( (signed __int16)v17 < 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 if ( BYTE3(v16->uAttributes) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 v18 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 v19 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 if ( v19 * v19 + v18 * v18 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 v20 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 v1->vPosition.z = v20[*v16->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 v2 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 v41 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 v40 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 v41 = (unsigned __int64)(58500i64 * v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 v1->vVelocity.x = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 v41 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 v40 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 v1->vVelocity.y = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 v41 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
1659 ++uFaceID;
8453114181af intermediate
Nomad
parents: 70
diff changeset
1660 v28 = __OFSUB__(uFaceID, 100);
8453114181af intermediate
Nomad
parents: 70
diff changeset
1661 v27 = uFaceID - 100 < 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 v1->vVelocity.z = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 if ( !(v27 ^ v28) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 if ( v42 <= v1->vPosition.z - 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 if ( !(v5 & 0x40) || _46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 v6 = pIndoor->pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 v1->vPosition.z = v42 + 1;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
1677 v7 = &v6[uFaceID];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 if ( v7->uPolygonType == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685 if ( v7->pFacePlane_old.vNormal.z < 45000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 v42 = v1->vVelocity.x;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
1690 uFaceID = 58500;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 v42 = (unsigned __int64)(58500i64 * v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 v1->vVelocity.x = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 v42 = v1->vVelocity.y;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
1694 v42 = (unsigned __int64)(uFaceID * (signed __int64)v42) >> 16;
8453114181af intermediate
Nomad
parents: 70
diff changeset
1695 uFaceID = 58500;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 v1->vVelocity.y = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 v42 = v1->vVelocity.z;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
1698 v42 = (unsigned __int64)(uFaceID * (signed __int64)v42) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 v9 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 v1->vVelocity.z = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 if ( v9 * v9 + v1->vVelocity.y * v1->vVelocity.y < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 v1->vVelocity.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 v1->vVelocity.y = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 v1->vVelocity.x = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 memset(&Dst, v8, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 v10 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 if ( v10 & 0x200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719 Dst.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 v11 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 v33 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 v31 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 if ( v10 & 0x400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731 Dst.uDiffuse = rand();
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1732 Dst.timeToLive = 64;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 Dst.uTextureID = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 v11 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 v33 = (TEXTURE_TYPE)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 v31 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1745 Dst.timeToLive = (unsigned __int8)(v11 & 0x80) + 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v31, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 pGame->pParticleEngine->AddParticle(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 //----- (00471C03) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 void LayingItem::UpdateObject_fn0_ODM(unsigned int uLayingItemID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 ObjectDesc *v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 signed int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 int v5; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 int v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 int v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 __int16 v10; // ax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 int v11; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 int v12; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 signed int v13; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 signed int v14; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 int v16; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 int v17; // ST10_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 signed int v18; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 signed int v19; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 Actor *v20; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 int v21; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 int v22; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 __int16 v23; // bx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 char v24; // al@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 signed int i; // edi@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 int v26; // edi@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 int v27; // eax@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 __int16 v28; // cx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 int v29; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 signed int v30; // edi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 BSPModel *v31; // ecx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 ODMFace *v32; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 int v33; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 int v34; // ecx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 int v35; // eax@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 Actor *v36; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 __int16 v37; // ax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 int v38; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 int v39; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 unsigned __int64 v40; // qax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 int v41; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 unsigned __int8 v42; // sf@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 unsigned __int8 v43; // of@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 int v44; // eax@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 __int16 v45; // bx@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 int v46; // eax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 const char *v47; // [sp-8h] [bp-B0h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 enum TEXTURE_TYPE v48; // [sp-4h] [bp-ACh]@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 int v49; // [sp+Ch] [bp-9Ch]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 int v50; // [sp+10h] [bp-98h]@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 Vec3_int_ v51; // [sp+14h] [bp-94h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 Particle_ Dst; // [sp+20h] [bp-88h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 unsigned int uLayingItemID_; // [sp+88h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 int v54; // [sp+8Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 int v55; // [sp+90h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 int v56; // [sp+94h] [bp-14h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 int v57; // [sp+98h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 int v58; // [sp+9Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 int v59; // [sp+A0h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 Actor *v60; // [sp+A4h] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820 uLayingItemID_ = uLayingItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 v1 = &pLayingItems[uLayingItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 v58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823 v2 = &pObjectList->pObjects[v1->uObjectDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 v57 = GetTerrainHeightsAroundParty(v1->vPosition.x, v1->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 v3 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 v4 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 v5 = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 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
1830 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 v54 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 v8 = v6 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 if ( v1->vPosition.z <= v6 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 if ( v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 v9 = v6 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838 if ( v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 v9 = v7 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 v7 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847 v58 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 v10 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 if ( !(v10 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 if ( v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857 if ( v57 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 v11 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 v12 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 _46DCC8_get_gravity_direction_outdoor(v12, v11, &v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 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
1865 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 v1->vVelocity.x += (unsigned int)(v56 * v51.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 v1->vVelocity.y += (unsigned int)(v56 * v51.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 v1->vVelocity.z += (unsigned int)(v56 * v51.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 v7 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 if ( v10 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 if ( v1->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 if ( !_46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883 if ( !(v2->uFlags & 0x80) || (v21 = -v1->vVelocity.z >> 1, v1->vVelocity.z = v21, (signed __int16)v21 < 10) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 v60 = (Actor *)v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 v55 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 v60 = (Actor *)((unsigned __int64)(58500i64 * (signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 v1->vVelocity.x = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 v60 = (Actor *)v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 v60 = (Actor *)((unsigned __int64)(v55 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1891 v55 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1892 v1->vVelocity.y = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 v60 = (Actor *)v1->vVelocity.z;
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 v22 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 v1->vVelocity.z = (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 if ( v1->vVelocity.y * v1->vVelocity.y + v22 * v22 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 memset(&Dst, 0, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 v23 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 if ( HIBYTE(v23) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 Dst.uDiffuse = 16727070;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 LABEL_83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 v47 = "effpar01";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 if ( HIBYTE(v23) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 Dst.uDiffuse = rand();
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1926 Dst.timeToLive = 64;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 Dst.uTextureID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 LABEL_89:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 Dst.flt_28 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 pGame->pParticleEngine->AddParticle(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 v47 = "effpar03";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
1940 Dst.timeToLive = (unsigned __int8)(v24 & 0x80) + 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v47, v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 if ( v1->vPosition.z > v7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 && (v13 = v1->vPosition.x, v13 >= -32768)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 && v13 <= 32768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 && (v14 = v1->vPosition.y, v14 >= -32768)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 && v14 <= 32768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 && v1->vPosition.z <= 13000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 || !(v2->uFlags & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 if ( v1->vPosition.z < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 v1->vPosition.z = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 if ( _46BFFA_check_object_intercept(uLayingItemID_, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 LABEL_92:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 stru_721530.field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 stru_721530.prolly_normal_d = v2->uRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 stru_721530.field_C = v2->uHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 stru_721530.field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 stru_721530.field_34.x = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 stru_721530.normal.x = stru_721530.field_34.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 v15 = v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 stru_721530.field_34.y = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 stru_721530.normal.y = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 stru_721530.field_34.z = v1->vPosition.z + stru_721530.prolly_normal_d + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 stru_721530.normal.z = stru_721530.field_34.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 stru_721530.field_1C = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 stru_721530.field_20 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 stru_721530.field_24 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 if ( stru_721530._47050A(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 _46E889_collide_against_bmodels(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 v16 = WorldPosToGridCellZ(v1->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 v17 = v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 v58 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 v18 = WorldPosToGridCellX(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 _46E26D_collide_against_sprites(v18, v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 if ( (v1->field_58 & 7) != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 _46EF01_collision_chech_player(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 if ( (v1->field_58 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 v19 = v1->field_58 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 if ( v19 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 if ( v19 < (signed int)(uNumActors - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 v60 = pActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 v20 = &pActors[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 if ( v20->GetActorsRelation(v60) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 _46DF1A_collide_against_actor(v56, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 ++v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 while ( v56 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 v27 = sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 stru_721530.normal2.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 stru_721530.normal2.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 v2->uHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 &v49,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 &v50,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 if ( v59 && v26 < v27 + 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 v44 = v27 + 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 v44 = v54 + 60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 LayingItem::_42F933(uLayingItemID_);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 v1->vPosition.x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 v1->vPosition.y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 v1->uSectorID = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 if ( !(HIBYTE(v2->uFlags) & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 memset(&Dst, 0, 0x68u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 v45 = v2->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 Dst.x = (double)v1->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 Dst.y = (double)v1->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 Dst.z = (double)v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 Dst.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 Dst.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 Dst.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 if ( HIBYTE(v45) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 Dst.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 Dst.uDiffuse = 16727070;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 goto LABEL_83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 if ( HIBYTE(v45) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 Dst.bFree = 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 v46 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 Dst.uTextureID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 Dst.uDiffuse = v46;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
2065 Dst.timeToLive = 64;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 Dst.bFree = 1032;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 Dst.uDiffuse = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 v24 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 v48 = (TEXTURE_TYPE)0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 v28 = LOWORD(stru_721530.uSectorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 v29 = v1->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 v1->uSectorID = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 if ( v2->uFlags & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 if ( v29 < v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 v1->vPosition.z = v54 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 v30 = (signed int)stru_721530.uFaceID >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 v32 = &v31->pFaces[v30 & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 if ( v32->uPolygonType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 v56 = abs(v32->pFacePlane.vNormal.z * v1->vVelocity.z + v32->pFacePlane.vNormal.y * v1->vVelocity.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 + v32->pFacePlane.vNormal.x * v1->vVelocity.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 if ( stru_721530.field_64 >> 3 > v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 v56 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 v57 = v32->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 v57 = (unsigned __int64)(v56 * (signed __int64)v57) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 v58 = v32->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 v58 = (unsigned __int64)(v56 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 v60 = (Actor *)v32->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)(signed int)v60) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 v1->vVelocity.x += 2 * v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 v1->vVelocity.y += 2 * v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 if ( v32->pFacePlane.vNormal.z <= 32000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 v37 = 2 * (short)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 v36 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 v57 = 32000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 v1->vVelocity.z += (signed __int16)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 v58 = (unsigned __int64)(v57 * (signed __int64)(signed int)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 v37 = (unsigned int)(v57 * (int)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 v1->vVelocity.z += v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 LABEL_70:
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
2126 if ( BYTE3(v32->uAttributes) & 0x10 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 EventProcessor(v32->sCogTriggeredID, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 v34 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 v1->vPosition.z = v33 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 if ( v1->vVelocity.y * v1->vVelocity.y + v34 * v34 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 LOWORD(v35) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 LABEL_74:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 v58 = v1->vVelocity.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 v57 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 v58 = (unsigned __int64)(58500i64 * v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 v1->vVelocity.x = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 v58 = v1->vVelocity.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 v57 = 58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 v1->vVelocity.y = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 v58 = v1->vVelocity.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 v43 = __OFSUB__(v55, 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 v42 = v55 - 100 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 v1->vVelocity.z = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 if ( !(v42 ^ v43) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 v57 = sub_452A9E(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 v38 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 v1->vPosition.x - pLevelDecorations[v30].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 v1->vPosition.y - pLevelDecorations[v30].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 v56 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 v39 = stru_5C6E00->SinCos(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 v60 = (Actor *)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 v40 = v39 * (signed __int64)v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 v58 = v40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 v1->vVelocity.x = WORD1(v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 v41 = stru_5C6E00->SinCos(v56 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 v60 = (Actor *)v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 v58 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 v1->vVelocity.y = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 goto LABEL_74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184 //----- (0047253E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185 void __cdecl UpdateObjects()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187 unsigned int v0; // ebx@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 __int16 v3; // dx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 ObjectDesc *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 int v5; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 __int16 v6; // cx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 signed int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 __int16 v8; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 unsigned int v10; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 signed int v11; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 int v12; // edi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 int v13; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 int v14; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 unsigned int v15; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 unsigned int v16; // edx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 unsigned int v17; // edx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 int v18; // [sp+4h] [bp-10h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 int v19; // [sp+8h] [bp-Ch]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 signed int v20; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 if ( (signed int)uNumLayingItems > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2213 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 v2 = (char *)&pLayingItems[0].uSpriteFrameID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 LOWORD(v0) = *((short *)v2 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 if ( v0 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 v0 &= 0xFFFFFFBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 *((short *)v2 - 2) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 v3 = *((short *)v2 - 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 v4 = &pObjectList->pObjects[*((short *)v2 - 14)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 if ( (v0 & 0x80u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229 v5 = *(int *)(v2 + 62) >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 *(int *)(v2 - 26) = pActors[v5].vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 *(int *)(v2 - 22) = pActors[v5].vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 *(int *)(v2 - 18) = pActors[v5].vPosition.z + pActors[v5].uActorHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 if ( !v3 || (v6 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2, *(short *)v2 = v6, !(v4->uFlags & 4)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 if ( v6 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 v7 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 v7 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 if ( v6 < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 v8 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248 *(short *)v2 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 v9 = v4->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 if ( !(v9 & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 goto LABEL_22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 if ( v8 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 LayingItem::_42F933(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 v11 = v4->uLifetime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 if ( v0 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 v11 = *((short *)v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 if ( v8 < v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 LABEL_22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 LayingItem::UpdateObject_fn0_BLV(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 LayingItem::UpdateObject_fn0_ODM(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 if ( pParty->bTurnBasedModeOn != 1 || !(*(v2 - 4) & 4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 v12 = abs(pParty->vPosition.x - *(int *)(v2 - 26));
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2272 v18 = abs(pParty->vPosition.y - *(int *)(v2 - 22));
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2273 v19 = abs(pParty->vPosition.z - *(int *)(v2 - 18));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 v14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276 v15 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 if ( v12 < v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 v13 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 v14 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 if ( v13 < v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 v16 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2285 v13 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2286 v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2288 if ( v14 < (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2289 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2290 v17 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2291 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2292 v14 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2294 v0 = (unsigned int)(11 * v14) >> 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2295 if ( (signed int)(v0 + (v15 >> 2) + v13) <= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2296 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2297 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2298 v10 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2299 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2301 v10 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2302 if ( !(v9 & 0x40) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2303 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2304 _46BFFA_check_object_intercept(v1, 8 * v1 | OBJECT_Item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2307 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2308 v2 += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2309 v1 = v20++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2311 while ( v20 < (signed int)uNumLayingItems );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2312 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2313 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2315 //----- (0047272C) --------------------------------------------------------
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2316 int _47272C_collide_agains_some_secotors_floors(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2318 signed int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2319 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2320 int v7; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2321 signed int v8; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2322
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2323 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2324 v5 = x - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2325 v7 = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2326 v8 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2327 *pSectorID = pIndoor->GetSector(x - 2, y, z + 40);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2328 result = _46ED1B_collide_against_floor(v5, v8, z + 40, pSectorID, pFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2329 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2331 *pSectorID = pIndoor->GetSector(v7 + 2, v8, z + 40);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2332 result = _46ED1B_collide_against_floor(v7 + 2, v8, z + 40, pSectorID, pFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2333 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2335 *pSectorID = pIndoor->GetSector(v7, v8 - 2, z + 40);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2336 result = _46ED1B_collide_against_floor(v7, v8 - 2, z + 40, pSectorID, pFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2337 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2338 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2339 *pSectorID = pIndoor->GetSector(v7, v8 + 2, z + 40);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2340 result = _46ED1B_collide_against_floor(v7, v8 + 2, z + 40, pSectorID, pFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2341 if ( result == -30000 || !*pSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2343 *pSectorID = pIndoor->GetSector(v7, v8, z + 140);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2344 result = _46ED1B_collide_against_floor(v7, v8, z + 140, pSectorID, pFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2349 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2350 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2351
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2352 //----- (00472866) --------------------------------------------------------
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2353 void BLV_ProcessPartyActions()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2355 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2356 int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2357 int v6; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2358 signed __int64 v8; // qax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2359 int v9; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2360 double v10; // st7@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2361 unsigned int v12; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2362 double v13; // st7@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2363 int v14; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2364 signed __int64 v15; // qax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2365 double v16; // st7@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2366 int v17; // eax@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2367 double v18; // st7@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2368 int v19; // ST40_4@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2369 int v20; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2370 double v21; // st7@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2371 int v22; // ST40_4@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2372 int v23; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2373 double v24; // st7@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2374 int v25; // ST40_4@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2375 int v26; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2376 double v27; // st7@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2377 int v28; // ST40_4@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2378 unsigned int v35; // eax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2379 int v36; // ecx@88
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2380 int new_party_z; // esi@96
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2381 int v38; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2382 int v39; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2383 int v40; // eax@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2384 Player **v41; // esi@113
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2385 int v42; // eax@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2386 signed int v43; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2387 BLVFace *v44; // esi@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2388 PolygonType v45; // al@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2389 int v46; // ecx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2390 char v47; // zf@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2391 int v48; // eax@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2392 int v49; // ST40_4@136
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2393 int v50; // ST40_4@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2394 int v51; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2395 int v52; // eax@140
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2396 signed int v53; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2397 int v54; // ebx@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2398 int v55; // ST30_4@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2399 AudioPlayer *v56; // ecx@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2400 SoundID v57; // [sp-20h] [bp-80h]@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2401 signed int v58; // [sp-1Ch] [bp-7Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2402 unsigned int v59; // [sp-18h] [bp-78h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2403 signed int v60; // [sp-14h] [bp-74h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2404 signed int v61; // [sp-10h] [bp-70h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2405 int v62; // [sp-Ch] [bp-6Ch]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2406 int v63; // [sp-8h] [bp-68h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2407 unsigned int v64; // [sp-8h] [bp-68h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2408 int v65; // [sp-4h] [bp-64h]@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2409 int v66; // [sp-4h] [bp-64h]@161
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2410 int v68; // [sp+10h] [bp-50h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2411 int v69; // [sp+10h] [bp-50h]@140
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2412 unsigned int uFaceEvent; // [sp+14h] [bp-4Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2413 signed int v71; // [sp+18h] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2414 signed int v72; // [sp+1Ch] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2415 signed int v73; // [sp+20h] [bp-40h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2416 int v74; // [sp+20h] [bp-40h]@140
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2417 bool bFeatherFall; // [sp+24h] [bp-3Ch]@15
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2418 unsigned int uSectorID; // [sp+28h] [bp-38h]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2419 int v78; // [sp+2Ch] [bp-34h]@1
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2420 unsigned int uFaceID; // [sp+30h] [bp-30h]@1
8453114181af intermediate
Nomad
parents: 70
diff changeset
2421 int v80; // [sp+34h] [bp-2Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2422 int v81; // [sp+38h] [bp-28h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2423 int v82; // [sp+3Ch] [bp-24h]@47
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2424 int _view_angle; // [sp+40h] [bp-20h]@47
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2425 int bJumping; // [sp+44h] [bp-1Ch]@1
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2426 int new_party_y; // [sp+48h] [bp-18h]@1
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2427 int new_party_x; // [sp+4Ch] [bp-14h]@1
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2428 int party_z; // [sp+50h] [bp-10h]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2429 int v89; // [sp+58h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2430 int angle; // [sp+5Ch] [bp-4h]@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2431
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2432 v89 = pParty->uFallSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2433 v1 = 0;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2434 new_party_y = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2435 v2 = 0;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2436 new_party_x = pParty->vPosition.x;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2437 party_z = pParty->vPosition.z;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2438 uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2439 v72 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2440 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2441 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2442 bJumping = 0;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2443 v80 = _46ED1B_collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2444 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2445 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2446 pParty->bFlying = 0;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2447 __debugbreak();
8453114181af intermediate
Nomad
parents: 70
diff changeset
2448 if (pParty->FlyActive())
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2449 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2450 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2451 if ( v80 == -30000 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2452 {
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2453 v80 = _47272C_collide_agains_some_secotors_floors(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2454 if ( v80 == -30000 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2456 pParty->vPosition.x = blv_prev_party_x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2457 pParty->vPosition.y = blv_prev_party_z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2458 pParty->vPosition.z = blv_prev_party_y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2459 pParty->uFallStartY = blv_prev_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2460 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2463 blv_prev_party_x = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2464 blv_prev_party_z = pParty->vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2465 blv_prev_party_y = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2466 if ( pParty->bTurnBasedModeOn != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2467 {
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2468 __debugbreak();
8453114181af intermediate
Nomad
parents: 70
diff changeset
2469 auto v67 = GetTickCount() / 500;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2470 if (dword_720CDC != v67 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2471 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2472 dword_4F8580[3 * dword_4F8580[0] + 1] = pParty->vPosition.x;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2473 dword_4F8580[3 * dword_4F8580[0] + 2] = pParty->vPosition.y;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
2474 dword_4F8580[3 * dword_4F8580[0]++ + 3] = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2475 if ( dword_4F8580[0] > 60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2476 dword_4F8580[0] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2477 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2478 dword_720CDC = v67;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2479 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2480 if (!pParty->FeatherFallActive())
8453114181af intermediate
Nomad
parents: 70
diff changeset
2481 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2482 bFeatherFall = false;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2483 if (!pParty->pPlayers[0].WearsItem(536, 16) &&
8453114181af intermediate
Nomad
parents: 70
diff changeset
2484 !pParty->pPlayers[1].WearsItem(536, 16) &&
8453114181af intermediate
Nomad
parents: 70
diff changeset
2485 !pParty->pPlayers[2].WearsItem(536, 16) &&
8453114181af intermediate
Nomad
parents: 70
diff changeset
2486 !pParty->pPlayers[3].WearsItem(536, 16))
8453114181af intermediate
Nomad
parents: 70
diff changeset
2487 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2488 v6 = pParty->uFallStartY;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2489 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2490 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2491 else
8453114181af intermediate
Nomad
parents: 70
diff changeset
2492 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2493 v6 = v80;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2494 bFeatherFall = true;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2495 pParty->uFallStartY = v80;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2496 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2497 LABEL_20:
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2498 if ( v6 - party_z > 512 && !bFeatherFall && party_z <= v80 + 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2500 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2502 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2503 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2504 else for (uint i = 0; i < 4; ++i)
8453114181af intermediate
Nomad
parents: 70
diff changeset
2505 { // receive falling damage
8453114181af intermediate
Nomad
parents: 70
diff changeset
2506 auto pPlayer = pParty->pPlayers + i;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2507
8453114181af intermediate
Nomad
parents: 70
diff changeset
2508 if (!pPlayer->HasEnchantedItemEquipped(72) &&
8453114181af intermediate
Nomad
parents: 70
diff changeset
2509 !pPlayer->WearsItem(529, 8))
8453114181af intermediate
Nomad
parents: 70
diff changeset
2510 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2511 v8 = (signed __int64)((double)pPlayer->GetMaxHealth() * 0.1);
8453114181af intermediate
Nomad
parents: 70
diff changeset
2512 pPlayer->ReceiveDamage((pParty->uFallStartY - party_z) * (signed int)v8 / 256, 4);
8453114181af intermediate
Nomad
parents: 70
diff changeset
2513 v9 = pPlayer->GetActualEndurance();
8453114181af intermediate
Nomad
parents: 70
diff changeset
2514 v10 = (double)(20 - pPlayer->_48EA1B_get_static_effect(v9)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2515 pPlayer->SetRecoveryTime((signed __int64)v10);
8453114181af intermediate
Nomad
parents: 70
diff changeset
2516 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2517 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2518 }
8453114181af intermediate
Nomad
parents: 70
diff changeset
2519 if ( party_z > v80 + 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2520 bJumping = 1;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2521 bFeatherFall = party_z - v80 <= 32;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2522 if ( party_z - v80 <= 32 )
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2523 pParty->uFallStartY = party_z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2524 if ( bWalkSound && pParty->field_6F8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2525 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2526 if ( party_z > v80 + 1 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2528 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2529 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2530 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2531 goto LABEL_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2532 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2533 party_z = v80 + 1;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2534 pParty->uFallStartY = v80 + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2535 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2536 goto LABEL_45;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2537 if (pParty->field_6F4_packedid != uFaceID)
8453114181af intermediate
Nomad
parents: 70
diff changeset
2538 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2539 auto pFace = &pIndoor->pFaces[uFaceID];
8453114181af intermediate
Nomad
parents: 70
diff changeset
2540 if (pFace->uAttributes & 0x04000000 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2541 {
8453114181af intermediate
Nomad
parents: 70
diff changeset
2542 uFaceEvent = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2543 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2546 LABEL_44:
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2547 pParty->field_6F4_packedid = uFaceID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2548 LABEL_45:
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2549 v68 = uFaceID;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2550 if ( pIndoor->pFaces[uFaceID].uAttributes & 0x10 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2551 v71 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2552 v81 = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2553 angle = pParty->sRotationY;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2554 _view_angle = pParty->sRotationX;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2555 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2556 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2557 / 180)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2558 LABEL_87:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2559 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2561 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2563 case PARTY_TurnLeft:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2564 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2565 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2566 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2567 goto LABEL_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2568 v13 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2569 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2570 case PARTY_TurnRight:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2571 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2572 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2573 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2574 goto LABEL_56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2575 v16 = (double)v82 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2576 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2577 case PARTY_FastTurnLeft:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2578 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2579 v12 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2580 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2582 LABEL_58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2583 v14 = angle + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2585 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2587 v13 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2588 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2589 v14 = angle + (unsigned __int64)(signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2591 angle = stru_5C6E00->uDoublePiMask & v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2592 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2593 case PARTY_FastTurnRight:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2594 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2595 LODWORD(v15) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2596 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2597 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2598 v16 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2599 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2600 v15 = (signed __int64)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2602 LABEL_56:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2603 angle = stru_5C6E00->uDoublePiMask & (angle - v15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2604 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2605 case PARTY_StrafeLeft:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2606 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2607 v17 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2608 v18 = (double)v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2609 //v88 = v18;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2610 v78 = (unsigned __int64)(v17 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2611 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2612 v19 = stru_5C6E00->SinCos(angle);
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2613 v78 = (unsigned __int64)(v19 * (signed __int64)((signed int)(signed __int64)(v18 * fWalkSpeedMultiplier) >> 1)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2614 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2615 case PARTY_StrafeRight:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2616 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2617 v20 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2618 v21 = (double)v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2619 //v88 = v21;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2620 v78 = (unsigned __int64)(v20 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2621 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2622 v22 = stru_5C6E00->SinCos(angle);
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2623 v78 = (unsigned __int64)(v22 * (signed __int64)((signed int)(signed __int64)(v21 * fWalkSpeedMultiplier) >> 1)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2624 goto LABEL_68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2625 case PARTY_WalkForward:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2626 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2627 v23 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2628 v24 = (double)v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2629 //v88 = v24;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2630 v78 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2631 v2 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2632 v25 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2633 v78 = (unsigned __int64)(v25 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2634 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2635 v1 += v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2636 goto LABEL_64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2637 case PARTY_WalkBackward:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2638 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2639 v26 = stru_5C6E00->SinCos(angle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2640 v27 = (double)v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2641 //v88 = v27;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2642 v78 = (unsigned __int64)(v26
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2643 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2644 v2 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2645 v28 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2646 v78 = (unsigned __int64)(v28
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2647 * (signed __int64)(signed int)(signed __int64)(v27 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2648 LABEL_68:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2649 v1 -= v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2650 LABEL_64:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2651 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2652 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2653 case PARTY_RunForward:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2654 //v29 = stru_5C6E00->SinCos(angle);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2655 //v30 = (double)v81;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2656 //v88 = (double)v81;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2657 v2 += (unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2658 //v31 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2659 v1 += (unsigned __int64)(stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi) * (signed __int64)(signed int)(2 * (unsigned __int64)(signed __int64)((double)v81 * fWalkSpeedMultiplier))) >> 16;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
2660 v72 = 1;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
2661 goto LABEL_87;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2662 case PARTY_RunBackward:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2663 //v32 = stru_5C6E00->SinCos(angle);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2664 //v33 = (double)v81;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2665 //v88 = (double)v81;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2666 v2 -= (unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2667 //v34 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2668 v1 -= (unsigned __int64)(stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
2669 //LABEL_70:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2670 v72 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2671 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2672 case PARTY_LookUp:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2673 __debugbreak();
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2674 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2675 if ( _view_angle > 128 )
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2676 _view_angle = 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2677 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2678 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2679 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2680 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2681 v63 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2682 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2683 case PARTY_LookDown:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2684 __debugbreak();
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2685 _view_angle += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2686 if ( _view_angle < -128 )
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2687 _view_angle = -128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2688 v35 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2689 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2691 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2692 v63 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2693 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2694 pPlayers[v35]->PlaySound(v63, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2696 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2697 case PARTY_CenterView:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2698 __debugbreak();
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2699 _view_angle = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2700 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2701 case PARTY_Jump:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2702 __debugbreak();
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2703 if ( (!bJumping || party_z <= v80 + 6 && v89 <= 0) && pParty->field_24 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2705 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2706 v89 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v89);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2708 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2709 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2710 goto LABEL_87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2713 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2714 pParty->sRotationY = angle;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2715 pParty->sRotationX = _view_angle;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2716 if ( bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2718 v89 += -2 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2720 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2722 if ( pIndoor->pFaces[v68].pFacePlane_old.vNormal.z < 32768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2723 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2724 v89 -= pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2725 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2726 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2727 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2728 goto LABEL_92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2729 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2731 if ( bJumping != v36 && v89 <= v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2733 if ( v89 < -500 && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2735 v41 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2736 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2738 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2739 (*v41)->PlayEmotion(46, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2740 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2742 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2744 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2746 LABEL_92:
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2747 pParty->uFallStartY = party_z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2748 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2749 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2751 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2752 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2754 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2755 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2756 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2757 stru_721530.field_8 = pParty->field_14 >> 1;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2758 auto v83 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2759 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2760 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2761 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2762 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2763 new_party_z = party_z;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2764 stru_721530.field_34.x = new_party_x;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2765 stru_721530.normal.x = new_party_x;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2766 stru_721530.field_1C = v2;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2767 stru_721530.field_34.y = new_party_y;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2768 stru_721530.normal.y = new_party_y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2769 stru_721530.field_20 = v1;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2770 stru_721530.normal.z = stru_721530.prolly_normal_d + party_z + 1;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2771 stru_721530.field_34.z = stru_721530.field_C + party_z + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2772 stru_721530.field_24 = v89;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2773 stru_721530.uSectorID = uSectorID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2774 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2775 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2776 v38 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2777 if ( stru_721530._47050A(v38) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2778 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2779 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2780 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2782 _46E44E_collide_against_faces_and_portals(1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2783 _46E0B2_collide_against_decorations();
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2784 for ( v80 = 0; v80 < (signed int)uNumActors; ++v80 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2785 _46DF1A_collide_against_actor(v80, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2786 if ( _46F04E_collide_against_portals() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2787 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2788 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2789 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2790 while ( v73 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2791 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2793 v39 = stru_721530.normal2.x;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2794 uSectorID = stru_721530.normal2.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2795 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2796 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2797 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2798 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2799 v39 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16) + new_party_x;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2800 uSectorID = new_party_y + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2801 v40 = new_party_z + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2802 }
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2803 v42 = _46ED1B_collide_against_floor(v39, uSectorID, v40 + 40, &stru_721530.uSectorID, &uFaceID);
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2804 if ( v42 == -30000 || v42 - new_party_z > 128 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2805 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2806 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2807 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2808 new_party_x = stru_721530.normal2.x;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2809 new_party_y = stru_721530.normal2.y;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2810 new_party_z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2811 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2812 }
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2813 new_party_x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2814 new_party_y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2815 v43 = stru_721530.uFaceID;
76
75994455e457 BLV collisions
Nomad
parents: 71
diff changeset
2816 uSectorID = stru_721530.uSectorID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2817 stru_721530.field_70 += stru_721530.field_7C;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2818 auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2819 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2821 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2822 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2823 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2824 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2825 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2827 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2829 v53 = sub_452A9E(v2 * v2 + v1 * v1);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2830 v80 = v53;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2831 v54 = stru_5C6E00->Atan2(
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2832 new_party_x - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.x,
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2833 new_party_y - pLevelDecorations[stru_721530.uFaceID >> 3].vPosition.y);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2834 v2 = (unsigned __int64)(stru_5C6E00->SinCos(v54) * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2835 v55 = stru_5C6E00->SinCos(v54 - stru_5C6E00->uIntegerHalfPi);
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2836 v1 = (unsigned __int64)(v55 * (signed __int64)v80) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2838 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2840 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2842 v44 = &pIndoor->pFaces[(signed int)stru_721530.uFaceID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2843 v45 = v44->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2844 if ( v45 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2846 if ( v89 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2847 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2848 v87 = pIndoor->pVertices[*v44->pVertexIDs].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2849 if ( pParty->uFallStartY - v87 < 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2850 pParty->uFallStartY = v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2851 if ( v2 * v2 + v1 * v1 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2853 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2854 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2856 goto LABEL_143;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2858 v46 = v89 * v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2859 v47 = v45 == 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2860 v48 = v44->pFacePlane_old.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2861 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2862 {
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2863 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2864 if ( stru_721530.field_64 >> 3 > v80 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2865 v80 = stru_721530.field_64 >> 3;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2866 v50 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2867 v81 = v44->pFacePlane_old.vNormal.y;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2868 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2869 v82 = v44->pFacePlane_old.vNormal.z;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2870 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2871 v2 += v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2872 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2873 v74 = v44->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2874 v51 = v44->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2875 v69 = v44->pFacePlane_old.vNormal.x;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2876 v80 = v51;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2877 v1 += v81;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2878 v52 = stru_721530.prolly_normal_d - ((v44->pFacePlane_old.dist + v87 * v74 + new_party_y * v51 + new_party_x * v69) >> 16);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2879 if ( v52 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2880 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2881 new_party_x += v52 * v69 >> 16;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2882 new_party_y += v52 * v80 >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2883 v87 += v52 * v74 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2885 LABEL_142:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2886 v43 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2887 LABEL_143:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2888 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 )
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2889 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2890 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2891 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2892 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2893 if ( stru_721530.field_64 >> 3 > v80 )
8453114181af intermediate
Nomad
parents: 70
diff changeset
2894 v80 = stru_721530.field_64 >> 3;
8453114181af intermediate
Nomad
parents: 70
diff changeset
2895 v49 = (unsigned __int64)(v80 * (signed __int64)v44->pFacePlane_old.vNormal.x) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2896 v81 = v44->pFacePlane_old.vNormal.y;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2897 v81 = (unsigned __int64)(v80 * (signed __int64)v81) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2898 v82 = v44->pFacePlane_old.vNormal.z;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2899 v82 = (unsigned __int64)(v80 * (signed __int64)v82) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2900 v2 += v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2901 v1 += v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2902 v89 += v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2903 if ( v2 * v2 + v1 * v1 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2904 goto LABEL_142;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2905 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2906 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2907 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2910 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2911 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2912 v1 = (unsigned __int64)(58500i64 * v1) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2913 ++v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2914 v89 = (unsigned __int64)(58500i64 * v89) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2915 if ( v83 >= 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2916 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2917 new_party_z = v87;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2918 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2921 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2922 {
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2923 if ( sub_452A9E((pParty->vPosition.x - new_party_x) * (pParty->vPosition.x - new_party_x) + (pParty->vPosition.y - new_party_y)
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2924 * (pParty->vPosition.y - new_party_y)
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2925 + (pParty->vPosition.z - new_party_z)
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2926 * (pParty->vPosition.z - new_party_z)) <= 16 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2927 goto LABEL_188;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2928 if ( v72 && (!bJumping || bFeatherFall) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2930 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2931 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2932 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2933 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2934 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2935 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2936 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2937 if ( !v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2938 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2939 v56 = pAudioPlayer;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2940 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2941 v57 = (SoundID)50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2942 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2943 v57 = (SoundID)64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2944 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2946 v57 = (SoundID)63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2947 LABEL_174:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2948 v56 = pAudioPlayer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2949 goto LABEL_175;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2950 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2951 if ( v78 && (!bJumping || bFeatherFall) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2953 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2954 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2955 v62 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2956 v61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2957 v60 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2958 v59 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2959 v58 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2960 if ( v71 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2962 v57 = (SoundID)102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2963 goto LABEL_174;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2965 v56 = pAudioPlayer;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2966 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2967 v57 = (SoundID)89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2968 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2969 v57 = (SoundID)103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2970 LABEL_175:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2971 pAudioPlayer->PlaySound(v57, v58, v59, v60, v61, v62, v64, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2973 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2975 LABEL_188:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2976 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2977 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2979 }
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2980 if ( !bJumping || bFeatherFall )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2981 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2982 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2983 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2984 BYTE1(pParty->uFlags) &= 0xFDu;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2985 pParty->vPosition.x = new_party_x;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2986 pParty->vPosition.z = new_party_z;
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
2987 pParty->vPosition.y = new_party_y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2988 pParty->uFallSpeed = v89;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2989 if ( !bJumping && BYTE3(pIndoor->pFaces[uFaceID].uAttributes) & 0x40 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2990 BYTE1(pParty->uFlags) |= 2u;
71
8453114181af intermediate
Nomad
parents: 70
diff changeset
2991 if (uFaceEvent)
8453114181af intermediate
Nomad
parents: 70
diff changeset
2992 EventProcessor(uFaceEvent, 0, 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2994
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2995
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2996 //----- (00473893) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2997 void __cdecl ODM_ProcessPartyActions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2999 int _zero; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3000 int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3001 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3002 int v3; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3003 Player **v4; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3004 int v5; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3005 int v6; // esi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3006 ODMFace *v7; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3007 unsigned int v8; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3008 double v9; // st7@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3009 signed __int64 v10; // qax@74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3010 double v11; // st7@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3011 int v12; // ecx@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3012 int v13; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3013 double v14; // st7@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3014 int v15; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3015 double v16; // st7@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3016 int v17; // eax@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3017 double v18; // st7@88
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3018 int v19; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3019 double v20; // st7@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3020 int v21; // eax@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3021 double v22; // st7@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3022 int v23; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3023 double v24; // st7@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3024 int v25; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3025 double v26; // st7@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3026 int v27; // eax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3027 double v28; // st7@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3028 signed __int64 v29; // qax@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3029 unsigned int v30; // eax@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3030 int v31; // eax@130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3031 int v32; // ecx@141
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3032 signed int v33; // eax@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3033 int v34; // esi@143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3034 unsigned int v35; // esi@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3035 int v36; // eax@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3036 signed int v37; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3037 signed int v38; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3038 signed int i; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3039 int v40; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3040 Player **v41; // esi@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3041 bool v42; // eax@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3042 signed int v43; // ecx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3043 signed int v44; // edx@184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3044 int v45; // ecx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3045 BSPModel *v46; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3046 ODMFace *v47; // esi@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3047 int v48; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3048 char v49; // zf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3049 char v50; // sf@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3050 unsigned __int8 v51; // of@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3051 int v52; // eax@203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3052 unsigned __int8 v53; // dl@205
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3053 BSPModel *v54; // eax@215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3054 int v55; // eax@217
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3055 signed int v56; // ebx@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3056 int v57; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3057 BSPModel *v58; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3058 unsigned __int64 v59; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3059 BSPModel *v60; // eax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3060 unsigned __int64 v61; // qax@228
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3061 int v62; // eax@241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3062 signed int v63; // ST04_4@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3063 signed int v64; // eax@255
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3064 unsigned int v65; // ebx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3065 unsigned int v66; // esi@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3066 int v67; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3067 signed int v68; // ecx@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3068 int v69; // eax@263
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3069 int v70; // ebx@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3070 int v71; // esi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3071 int v72; // edi@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3072 int v73; // eax@271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3073 Player **v74; // esi@283
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3074 int v75; // eax@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3075 unsigned int v76; // edi@293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3076 bool v77; // edx@297
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3077 bool v78; // ecx@303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3078 int v79; // ecx@314
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3079 __int16 v80; // dx@317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3080 int v81; // ebx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3081 int v82; // ecx@318
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3082 int v83; // eax@321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3083 Player **v84; // esi@333
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3084 int v85; // eax@334
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3085 int v86; // [sp-20h] [bp-B4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3086 int v87; // [sp-20h] [bp-B4h]@248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3087 signed int v88; // [sp-1Ch] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3088 unsigned int v89; // [sp-18h] [bp-ACh]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3089 signed int v90; // [sp-14h] [bp-A8h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3090 signed int v91; // [sp-10h] [bp-A4h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3091 int v92; // [sp-Ch] [bp-A0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3092 int v93; // [sp-8h] [bp-9Ch]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3093 unsigned int v94; // [sp-8h] [bp-9Ch]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3094 int v95; // [sp-4h] [bp-98h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3095 int v96; // [sp-4h] [bp-98h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3096 int v97; // [sp+Ch] [bp-88h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3097 int v98; // [sp+10h] [bp-84h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3098 int v99; // [sp+14h] [bp-80h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3099 int v100; // [sp+18h] [bp-7Ch]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3100 bool v101; // [sp+1Ch] [bp-78h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3101 int v102; // [sp+20h] [bp-74h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3102 int v103; // [sp+24h] [bp-70h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3103 int bFeatherFall; // [sp+28h] [bp-6Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3104 int v105; // [sp+2Ch] [bp-68h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3105 int bWaterWalk; // [sp+30h] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3106 bool v107; // [sp+34h] [bp-60h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3107 int v108; // [sp+38h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3108 int v109; // [sp+3Ch] [bp-58h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3109 int v110; // [sp+40h] [bp-54h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3110 int v111; // [sp+44h] [bp-50h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3111 int bJumping; // [sp+48h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3112 int v113; // [sp+4Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3113 unsigned int v114; // [sp+50h] [bp-44h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3114 int _walk_speed; // [sp+54h] [bp-40h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3115 int v116; // [sp+58h] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3116 int v117; // [sp+5Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3117 int v118; // [sp+60h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3118 Player **v119; // [sp+64h] [bp-30h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3119 int _angle_x; // [sp+68h] [bp-2Ch]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3120 int v121; // [sp+6Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3121 unsigned int v122; // [sp+70h] [bp-24h]@180
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3122 int v123; // [sp+74h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3123 int v124; // [sp+78h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3124 int _angle_y; // [sp+7Ch] [bp-18h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3125 int v126; // [sp+80h] [bp-14h]@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3126 BSPModel *v127; // [sp+84h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3127 int v128; // [sp+88h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3128 int v129; // [sp+8Ch] [bp-8h]@92
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3129 int v130; // [sp+90h] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3130
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3131 v121 = pParty->uFallSpeed;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3132 v123 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3133 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3134 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3135 v103 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3136 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3137 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3138 v116 = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3139 v117 = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3140 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3141 bJumping = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3142 v118 = GetTerrainHeightsAroundParty(pParty->vPosition.x, pParty->vPosition.y);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3143 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3144 v124 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3145 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3146 v102 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3147 v127 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3148 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3149 if ( SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3150 || SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 && LODWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3152 bFeatherFall = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3153 v119 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3154 while ( !(*v119)->WearsItem(536, 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3156 ++v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3157 if ( (signed int)v119 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3158 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3161 bFeatherFall = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3162 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3163 if ( (signed __int64)pParty->pPartyBuffs[18].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3165 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3167 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3169 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3170 bWaterWalk = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3171 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3172 if ( !(pParty->pPartyBuffs[18].uFlags & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3173 && *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[18].uCaster + 10] <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3174 bWaterWalk = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3175 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3176 v3 = sub_46D49E_prolly_get_world_y_under_party(v116, v117, v123, pParty->uPartyHeight, &v130, &v108, bWaterWalk);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3177 v111 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3178 if ( bFeatherFall )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3179 pParty->uFallStartY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3180 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3181 v3 = pParty->uFallStartY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3182 if ( v3 - v123 > 512 && !bFeatherFall && v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3183 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3184 if ( BYTE1(pParty->uFlags) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3186 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3188 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3190 v4 = &pPlayers[1]; // receive falling damage
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3191 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3193 if ( !(*v4)->HasEnchantedItemEquipped(72) && !(*v4)->WearsItem(529, 8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3195 v105 = (*v4)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3196 (*v4)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3197 (signed int)((pParty->uFallStartY - v123) * (unsigned __int64)(signed __int64)((double)v105 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3198 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3199 v5 = (*v4)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3200 v105 = 20 - (*v4)->_48EA1B_get_static_effect(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3201 (*v4)->SetRecoveryTime((signed __int64)((double)v105 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3203 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3204 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3205 while ( (signed int)v4 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3206 _zero = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3209 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3210 if ( pParty->bFlying != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3211 v109 = sub_46D8E3(v116, v117, v123 + pParty->uPartyHeight, (int)&v102);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3212 v107 = v108 == _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3213 v105 = v111 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3214 if ( v123 <= v111 + 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3215 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3216 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3217 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3218 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3219 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3220 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3221 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3223 v101 = v123 - v111 <= 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3224 if ( bWalkSound != _zero && pParty->field_6F8 > _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3225 pParty->field_6F8 -= pEventTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3226 if ( !bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3227 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3228 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < _zero || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= _zero) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3229 pParty->bFlying = _zero;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3230 if ( bJumping == _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3232 if ( pParty->field_6F4_packedid != (8 * v108 | OBJECT_BModel) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3234 if ( v108 != _zero )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3236 if ( v108 >> 6 < pOutdoor->uNumBModels )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3238 v7 = (ODMFace *)&pOutdoor->pBModels[v108 >> 6].pFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3239 v6 = v108 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3240 if ( *(char *)(v7->pFacePlane.vNormal.x + 308 * v6 + 31) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3242 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3243 v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3248 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3250 _walk_speed = pParty->uWalkSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3251 _angle_y = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3252 _angle_x = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3253 v126 = pEventTimer->dt_in_some_format;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3254 v119 = (Player **)((unsigned __int64)(pEventTimer->dt_in_some_format
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3255 * (signed __int64)((signed int)(pParty->field_20_prolly_turn_speed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3256 * stru_5C6E00->uIntegerPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3257 / 180)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3258 LABEL_118:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3259 while ( pPartyActionQueue->uNumActions )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3261 switch ( pPartyActionQueue->Next() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3262 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3263 case PARTY_FlyUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3264 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3266 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3267 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3268 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3269 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3270 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3271 if ( pParty->vPosition.z < 4000 || bJumping )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3273 v123 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3274 v113 += 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3275 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3276 if ( v123 > 4000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3278 v123 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3279 v113 = 4000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3281 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3282 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3283 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3284 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3285 if ( v102 && v123 < v109 && (signed int)(pParty->uPartyHeight + v123) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3287 pParty->field_6E0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3288 pParty->field_6E4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3289 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3290 BYTE1(pParty->uFlags) |= 1u;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3291 pParty->vPosition.z = v109 - pParty->uPartyHeight - 31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3292 pParty->field_6F0 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3293 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3294 v123 = v109 - pParty->uPartyHeight - 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3295 v113 = pParty->field_6F0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3296 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3297 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3298 v127 = (BSPModel *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3302 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3303 case PARTY_FlyDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3304 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 || bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3306 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3307 if ( bUnderwater
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3308 || pParty->pPartyBuffs[7].uFlags & 1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3309 || *(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3311 v123 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3312 v113 -= 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3313 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3314 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3315 pParty->bFlying = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3316 v127 = (BSPModel *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3317 if ( v123 <= v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3319 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3320 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3324 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3325 case PARTY_TurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3326 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3327 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3328 goto LABEL_80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3329 v9 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3330 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3331 case PARTY_TurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3332 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3333 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3334 goto LABEL_77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3335 v11 = (double)(signed int)v119 * fTurnSpeedMultiplier;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3336 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3337 case PARTY_FastTurnLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3338 v8 = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3339 if ( uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3341 LABEL_80:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3342 v12 = v8 + _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3343 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3344 _angle_y = stru_5C6E00->uDoublePiMask & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3346 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3348 v9 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3349 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3350 _angle_y = stru_5C6E00->uDoublePiMask & (_angle_y + (unsigned __int64)(signed __int64)v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3352 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3353 case PARTY_FastTurnRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3354 LODWORD(v10) = uTurnSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3355 if ( !uTurnSpeed )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3357 v11 = (fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)(signed int)v119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3358 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3359 v10 = (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3360 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3361 LABEL_77:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3362 v12 = _angle_y - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3363 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3364 case PARTY_StrafeLeft:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3365 v13 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3366 v14 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3367 v126 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3368 *(float *)&v128 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3369 v124 = (unsigned __int64)(v13 * (signed __int64)((signed int)(signed __int64)(v14 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3370 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3371 v126 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3372 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3373 * (signed __int64)((signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3374 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3375 case PARTY_StrafeRight:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3376 v15 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3377 v16 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3378 v126 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3379 *(float *)&v128 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3380 v124 = (unsigned __int64)(v15 * (signed __int64)((signed int)(signed __int64)(v16 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3381 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3382 v126 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3383 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3384 * (signed __int64)((signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier) >> 1)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3385 goto LABEL_90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3386 case PARTY_WalkForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3387 v17 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3388 v18 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3389 v126 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3390 *(float *)&v128 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3391 v124 = (unsigned __int64)(v17 * (signed __int64)(signed int)(signed __int64)(v18 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3392 v2 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3393 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3394 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3395 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3396 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3397 v1 += v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3398 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3399 case PARTY_WalkBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3400 v19 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3401 v20 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3402 v126 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3403 *(float *)&v128 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3404 v124 = (unsigned __int64)(v19
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3405 * (signed __int64)(signed int)(signed __int64)(v20 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3406 v2 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3407 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3408 v124 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3409 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3410 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3411 LABEL_90:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3412 v1 -= v124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3413 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3414 case PARTY_RunForward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3415 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3417 v21 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3418 v22 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3419 v126 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3420 *(float *)&v128 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3421 v129 = (unsigned __int64)(v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3422 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3423 * (unsigned __int64)(signed __int64)(v22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3424 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3425 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3426 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3427 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3428 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3429 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3430 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3431 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3432 goto LABEL_93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3434 if ( v118 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3436 v23 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3437 v24 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3438 v126 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3439 *(float *)&v128 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3440 v129 = (unsigned __int64)(v23 * (signed __int64)(signed int)(signed __int64)(v24 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3441 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3442 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3443 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3444 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128 * fWalkSpeedMultiplier)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3445 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3446 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3448 v25 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3449 v26 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3450 v114 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3451 *(float *)&v128 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3452 v129 = (unsigned __int64)(v25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3453 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3454 * (unsigned __int64)(signed __int64)(v26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3455 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3456 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3457 v114 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3458 v129 = (unsigned __int64)((signed int)v114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3459 * (signed __int64)(signed int)(2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3460 * (unsigned __int64)(signed __int64)(*(float *)&v128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3461 * fWalkSpeedMultiplier))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3462 v1 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3463 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3464 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3465 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3466 case PARTY_RunBackward:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3467 v27 = stru_5C6E00->SinCos(_angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3468 v28 = (double)_walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3469 v126 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3470 *(float *)&v128 = v28;
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3471 v29 = (signed __int64)(v28 * fBackwardWalkSpeedMultiplier);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3472 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3474 v129 = (unsigned __int64)(v126 * (signed __int64)(4 * (signed int)v29)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3475 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3476 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3477 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3478 * (signed __int64)(signed int)(4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3479 * (unsigned __int64)(signed __int64)(*(float *)&v128
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3480 * fBackwardWalkSpeedMultiplier))) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3481 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3482 LABEL_93:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3483 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3485 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3487 v129 = (unsigned __int64)(v126 * (signed __int64)(signed int)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3488 v2 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3489 v126 = stru_5C6E00->SinCos(_angle_y - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3490 v129 = (unsigned __int64)(v126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3491 * (signed __int64)(signed int)(signed __int64)(*(float *)&v128
70
47736b43558d Party movement & ItemsTable::GenerateItem stack fix
Nomad
parents: 68
diff changeset
3492 * fBackwardWalkSpeedMultiplier)) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3493 v1 -= v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3494 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3495 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3496 v124 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3497 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3498 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3499 case PARTY_LookUp:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3500 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * 25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3501 if ( _angle_x > 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3502 _angle_x = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3503 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3504 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3505 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3506 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3507 v93 = 63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3508 goto _play_player_sound;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3509 case PARTY_LookDown:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3510 _angle_x += (signed __int64)(flt_6BE150_look_up_down_dangle * -25.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3511 if ( _angle_x < -128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3512 _angle_x = -128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3513 v30 = uActiveCharacter;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3514 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3516 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3517 v93 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3518 _play_player_sound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3519 pPlayers[v30]->PlaySound(v93, v95);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3520 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3521 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3522 case PARTY_CenterView:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3523 _angle_x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3524 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3525 case PARTY_Jump:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3526 if ( (!v118 || v108) && !bJumping && pParty->field_24 && !(pParty->uFlags & 4) && !(BYTE1(pParty->uFlags) & 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3528 v126 = pParty->field_24 << 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3529 bJumping = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3530 v121 = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)v121);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3532 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3533 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3534 goto LABEL_118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3535 case PARTY_Land:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3536 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3538 BYTE1(pParty->uFlags) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3539 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3540 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3541 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3542 pPartyActionQueue->uNumActions = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3543 goto LABEL_123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3546 LABEL_123:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3547 pParty->sRotationY = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3548 pParty->sRotationX = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3549 if ( v123 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3550 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3551 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3553 LABEL_130:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3554 v31 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3555 v126 = stru_5C6E00->SinCos(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3556 v129 = (unsigned __int64)(4i64 * v126) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3557 v123 = v113 + v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3558 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3559 v123 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3560 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3561 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3562 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3563 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3564 goto LABEL_141;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3566 if ( v130 && v121 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3567 sub_42F960_create_object(v116, v117, v111);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3568 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3569 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3570 pParty->uFallStartY = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3572 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3573 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3574 v113 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3575 if ( SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3576 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3577 stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3578 LABEL_141:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3579 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3580 if ( bJumping && !pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3582 v33 = -(pEventTimer->uTimeElapsed * GetGravityStrength());
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3583 v34 = v121 + 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3584 v121 += 2 * v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3585 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3586 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3587 if ( !v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3589 v34 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3590 LABEL_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3591 if ( bJumping == v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3592 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3593 goto LABEL_164;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3594 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3595 if ( !bJumping )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3597 if ( v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3598 goto LABEL_150;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3599 v123 = v111;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3600 _46DCC8_get_gravity_direction_outdoor(v116, v117, (Vec3_int_ *)&v98);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3601 v35 = v121 + -8 * pEventTimer->uTimeElapsed * GetGravityStrength();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3602 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
3603 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v98) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3604 v2 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3605 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v99) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3606 v1 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3607 v128 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3608 v127 = (BSPModel *)((unsigned __int64)(v129 * (signed __int64)v100) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3609 v34 = (int)((char *)v127 + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3610 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3611 v121 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3612 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3614 v34 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3615 LABEL_164:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3616 if ( !bUnderwater && v34 <= v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3617 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3618 if ( v34 < -500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3619 && !pParty->bFlying
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3620 && pParty->vPosition.z - v111 > 1000
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3621 && SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) <= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3622 && (SHIDWORD(pParty->pPartyBuffs[5].uExpireTime) < 0 || !LODWORD(pParty->pPartyBuffs[5].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3624 v41 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3625 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3627 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) && (*v41)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3628 (*v41)->PlaySound(66, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3629 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3631 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3633 goto LABEL_151;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3634 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3635 LABEL_150:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3636 pParty->uFallStartY = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3637 LABEL_151:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3638 if ( v2 * v2 + v1 * v1 < 400 && !v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3640 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3641 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3643 stru_721530.field_84 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3644 stru_721530.field_70 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3645 stru_721530.prolly_normal_d = pParty->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3646 stru_721530.field_8 = pParty->field_14 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3647 v126 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3648 stru_721530.field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3649 stru_721530.field_C = pParty->uPartyHeight - 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3650 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3652 stru_721530.field_34.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3653 stru_721530.normal.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3654 stru_721530.field_1C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3655 stru_721530.field_34.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3656 stru_721530.normal.y = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3657 stru_721530.normal.z = stru_721530.prolly_normal_d + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3658 stru_721530.field_34.z = stru_721530.field_C + v123 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3659 stru_721530.field_20 = v128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3660 stru_721530.field_24 = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3661 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3662 stru_721530.uSectorID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3663 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3664 v36 = 13312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3665 if ( stru_721530._47050A(v36) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3666 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3667 _46E889_collide_against_bmodels(1u);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3668 v37 = WorldPosToGridCellZ(pParty->vPosition.y);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3669 v38 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3670 _46E26D_collide_against_sprites(v38, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3671 _46ED8A_collide_against_layingItems(4u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3672 for ( i = 0; i < (signed int)uNumActors; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3673 _46DF1A_collide_against_actor(i, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3674 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3676 _angle_x = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3677 _angle_y = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3678 v40 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3679 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3680 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3682 _angle_x = v116 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3683 _angle_y = v117 + ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3684 v127 = (BSPModel *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3685 v40 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3687 v122 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3688 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
3689 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
3690 v119 = (Player **)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3691 v116,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3692 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3693 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3694 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3695 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3696 &v110,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3697 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3698 v127 = (BSPModel *)GetTerrainHeightsAroundParty(_angle_x, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3699 v42 = GetTerrainHeightsAroundParty(v116, _angle_y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3700 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3701 v118 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3702 if ( !v97 && !v110 && !v108 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3703 v107 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3704 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3705 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3706 if ( bUnderwater || !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3707 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3708 if ( v127 && v129 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3709 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3710 if ( v118 && (signed int)v119 > v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3711 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3712 if ( v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3713 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3714 if ( v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3715 goto LABEL_198;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3716 v127 = (BSPModel *)sub_46D49E_prolly_get_world_y_under_party(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3717 _angle_x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3718 _angle_y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3719 v40,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3720 pParty->uPartyHeight,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3721 &v130,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3722 &v108,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3723 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3724 if ( GetTerrainHeightsAroundParty(_angle_x, _angle_y) && (signed int)v127 <= v123 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3726 v43 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3727 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3728 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3729 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3730 goto LABEL_199;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3731 LABEL_198:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3732 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3734 LABEL_199:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3735 if ( stru_721530.field_7C >= stru_721530.field_6C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3737 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3738 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3739 v116 = stru_721530.normal2.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3740 v117 = stru_721530.normal2.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3742 v123 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3743 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3745 stru_721530.field_70 += stru_721530.field_7C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3746 v116 = _angle_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3747 v117 = _angle_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3748 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3749 v123 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3750 if ( (stru_721530.uFaceID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3752 if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3753 && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3754 pParty->pPartyBuffs[11].Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3755 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3756 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3758 if ( (stru_721530.uFaceID & 7) == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3760 v56 = sub_452A9E(v2 * v2 + v128 * v128);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3761 v118 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3762 v57 = stru_5C6E00->Atan2(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3763 _angle_x - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3764 _angle_y - pLevelDecorations[(signed int)stru_721530.uFaceID >> 3].vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3765 v129 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3766 v58 = (BSPModel *)stru_5C6E00->SinCos(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3767 v127 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3768 v59 = (signed int)v58 * (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3769 v122 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3770 v2 = v59 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3771 v60 = (BSPModel *)stru_5C6E00->SinCos(v129 - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3772 v127 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3773 v61 = (signed int)v60 * (signed __int64)v118;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3774 v122 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3775 v128 = v61 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3777 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3778 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3779 if ( (stru_721530.uFaceID & 7) == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3781 pParty->bFlying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3782 v46 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3783 v127 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3784 v47 = &v46->pFaces[((signed int)stru_721530.uFaceID >> 3) & 0x3F];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3785 v48 = v47->pBoundingBox.z2 - v47->pBoundingBox.z1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3786 v51 = __OFSUB__(v48, 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3787 v49 = v48 == 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3788 v50 = v48 - 32 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3789 v52 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3790 v129 = (unsigned __int8)(v50 ^ v51 | v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3791 v119 = (Player **)(v52 < 46378);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3792 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3793 v119 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3794 v53 = v47->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3795 if ( v53 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3797 if ( v121 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3798 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3799 v123 = v127->pVertices.pVertices[v47->pVertexIDs[0]].z + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3800 if ( v2 * v2 + v128 * v128 < 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3801 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3802 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3803 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3805 goto LABEL_221;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3807 if ( !v129 && (v53 != 4 || v119) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3808 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3809 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3810 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3811 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3812 v129 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3813 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3814 _walk_speed = v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3815 _walk_speed = (unsigned __int64)(v118 * (signed __int64)_walk_speed) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3816 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3817 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3819 v127 = (BSPModel *)v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3820 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3821 v54 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3823 v121 += (int)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3824 v128 += _walk_speed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3825 v2 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3826 v55 = stru_721530.prolly_normal_d
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3827 - ((signed int)(v47->pFacePlane.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3828 + v122 * v47->pFacePlane.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3829 + _angle_y * v47->pFacePlane.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3830 + _angle_x * v47->pFacePlane.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3831 if ( v55 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3833 v116 = _angle_x + (v47->pFacePlane.vNormal.x * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3834 v117 = _angle_y + (v47->pFacePlane.vNormal.y * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3835 if ( !v119 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3836 v123 = v122 + (v47->pFacePlane.vNormal.z * v55 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3838 LABEL_220:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3839 v45 = stru_721530.uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3840 LABEL_221:
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3841 if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uAttributes) & 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3842 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3843 pParty->field_6F4_packedid = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3844 v103 = v47->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3846 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3847 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3848 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3849 if ( stru_721530.field_64 >> 3 > v118 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3850 v118 = stru_721530.field_64 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3851 v122 = v47->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3852 v122 = (unsigned __int64)(v118 * (signed __int64)(signed int)v122) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3853 v127 = (BSPModel *)v47->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3854 v127 = (BSPModel *)((unsigned __int64)(v118 * (signed __int64)(signed int)v127) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3855 v129 = v47->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3856 v129 = (unsigned __int64)(v118 * (signed __int64)v129) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3857 v121 += v129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3858 v2 += v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3859 v128 += (int)v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3860 if ( v2 * v2 + v128 * v128 >= 400 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3861 goto LABEL_220;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3862 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3863 v121 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3864 *(float *)&v128 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3867 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3868 v2 = (unsigned __int64)(58500i64 * v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3869 v127 = (BSPModel *)58500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3870 v128 = (unsigned __int64)(58500i64 * v128) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3871 v122 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3872 ++v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3873 v121 = (unsigned __int64)(58500i64 * v121) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3874 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3875 while ( v126 < 100 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3876 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3877 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3878 v122 = abs(pParty->vPosition.x - v116);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3879 v126 = abs(pParty->vPosition.y - v117);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3880 v62 = abs(pParty->vPosition.z - v123);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3881 if ( sub_452A9E(v122 * v122 + v126 * v126 + v62 * v62) < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3882 goto LABEL_344;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3883 if ( v114 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3885 if ( !v107
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3886 && !(BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uAttributes) & 0x20) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3888 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3889 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3890 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3891 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3892 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3893 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3894 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3895 v87 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3896 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3898 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3899 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3900 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3901 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3902 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3903 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3904 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3905 v86 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3906 LABEL_255:
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3907 v63 = WorldPosToGridCellZ(pParty->vPosition.y) - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3908 v64 = WorldPosToGridCellX(pParty->vPosition.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3909 v87 = pOutdoor->_47EE49(v64, v63, v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3910 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3911 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3912 if ( v124 && (!bJumping || v101) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3914 if ( v107
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
3915 || BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uAttributes) & 0x20 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3916 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3917 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3918 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3919 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3920 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3921 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3922 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3923 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3924 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3925 goto LABEL_255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3927 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3928 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3929 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3930 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3931 v90 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3932 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3933 v88 = 804;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3934 v87 = 103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3935 LABEL_257:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3936 pAudioPlayer->PlaySound((SoundID)v87, v88, v89, v90, v91, v92, v94, v96);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3938 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3940 LABEL_344:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3941 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3942 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3945 if ( !bJumping || v101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3946 pParty->uFlags &= 0xFFFFFFF7u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3947 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3948 pParty->uFlags |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3949 v126 = WorldPosToGridCellX(pParty->vPosition.x);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3950 v65 = WorldPosToGridCellZ(pParty->vPosition.y) - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3951 v114 = WorldPosToGridCellX(v116);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3952 v66 = WorldPosToGridCellZ(v117) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3953 v127 = (BSPModel *)(((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v65) >> 1) & 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3954 v122 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v114, v65) >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3955 v67 = pOutdoor->ActuallyGetSomeOtherTileInfo(v126, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3956 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3957 v69 = ((unsigned int)~v67 >> 1) & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3958 if ( v114 == v126 && v66 == v65 && v122 && v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3959 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3960 if ( !v107 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3961 v68 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3962 if ( v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3964 v70 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3965 v71 = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3966 v72 = v117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3967 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3968 v73 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3969 pParty->vPosition.x = v116;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3970 pParty->vPosition.y = v117;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3971 pParty->vPosition.z = v123;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3972 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3973 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3974 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3975 v73 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3976 pParty->uFallStartY = 8160;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3977 pParty->vPosition.z = 8160;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3978 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3979 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3980 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v71)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3981 && pParty->vPosition.y == v72
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3982 && (v73 = pParty->vPosition.z, pParty->vPosition.z == v70) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3984 if ( v73 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3986 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3987 v73 = v105;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
3988 pParty->vPosition.z = v105;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3989 if ( pParty->uFallStartY - v70 > 512 && !bFeatherFall && v70 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3991 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3993 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3994 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3995 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3997 v74 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3998 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4000 v110 = (*v74)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4001 (*v74)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4002 (signed int)((pParty->uFallStartY - v70) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4003 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4004 v75 = (*v74)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4005 v110 = 20 - (*v74)->_48EA1B_get_static_effect(v75);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4006 (*v74)->SetRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4007 (signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4008 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4010 while ( (signed int)v74 <= (signed int)&pPlayers[4] );
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4011 v73 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4014 pParty->uFallStartY = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4015 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4016 if ( v102 && v73 < v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4018 if ( (signed int)(pParty->uPartyHeight + v73) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4019 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4020 pParty->vPosition.z = v109 - pParty->uPartyHeight - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4021 pParty->field_6F0 = v109 - pParty->uPartyHeight - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4022 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4024 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4025 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4026 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4028 v76 = pParty->bFlying;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4029 if ( pParty->bFlying || v101 == 0 || bWaterWalk || !v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4030 v77 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4031 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4032 v77 = v122 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4033 v114 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4034 if ( !pParty->bFlying && v101 != 0 && !bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4036 if ( v127 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4038 v78 = v69 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4039 goto LABEL_306;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4041 v114 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4042 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4043 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4044 LABEL_306:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4045 if ( v77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4046 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4047 pParty->vPosition.x = v116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4048 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4049 goto LABEL_313;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4050 goto LABEL_312;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4052 if ( v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4054 LABEL_312:
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4055 pParty->vPosition.y = v117;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4056 LABEL_313:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4057 if ( bWaterWalk )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4059 LOBYTE(pParty->uFlags) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4060 v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4061 *(short *)&stru_5E4C90.field_4B[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4062 if ( !v122 || !v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4063 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4064 if ( !v76 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4066 v80 = *(short *)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4067 LOBYTE(pParty->uFlags) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4068 *(short *)v79 = v80 & 0xFFFE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4072 goto LABEL_318;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4074 if ( bWalkSound && pParty->field_6F8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4076 pAudioPlayer->_4AA258(804);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4077 pParty->field_6F8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4078 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4079 LABEL_318:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4080 v81 = v123;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4081 v82 = v123;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4082 pParty->vPosition.z = v123;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4083 if ( v123 > 8160 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4084 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4085 v82 = 8160;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4086 pParty->uFallStartY = 8160;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4087 pParty->vPosition.z = 8160;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4089 LOWORD(pParty->uFlags) &= 0xFDFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4090 pParty->uFallSpeed = v121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4091 pParty->field_6F0 = v113;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4092 if ( v114 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4093 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4094 v83 = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v110, 1);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4095 v82 = pParty->vPosition.z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4096 if ( pParty->vPosition.z <= v83 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4097 pParty->uFlags |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4099 if ( !v103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4100 || (EventProcessor(v103, 0, 1), pParty->vPosition.x == v116)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4101 && pParty->vPosition.y == v117
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4102 && (v82 = pParty->vPosition.z, pParty->vPosition.z == v81) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4103 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4104 if ( v82 < v111 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4106 v82 = v105;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4107 pParty->uFallSpeed = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4108 pParty->vPosition.z = v105;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4109 if ( pParty->uFallStartY - v81 > 512 && !bFeatherFall && v81 <= v105 && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4111 if ( pParty->uFlags & 0x100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4113 BYTE1(pParty->uFlags) &= 0xFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4115 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4116 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4117 v84 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4118 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4120 v110 = (*v84)->GetMaxHealth();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4121 (*v84)->ReceiveDamage(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4122 (signed int)((pParty->uFallStartY - v81) * (unsigned __int64)(signed __int64)((double)v110 * 0.1)) / 256,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4123 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4124 v85 = (*v84)->GetActualEndurance();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4125 v110 = 20 - (*v84)->_48EA1B_get_static_effect(v85);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4126 (*v84)->SetRecoveryTime((signed __int64)((double)v110 * flt_6BE3A4_debug_recmod1 * 2.133333333333333));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4127 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4129 while ( (signed int)v84 <= (signed int)&pPlayers[4] );
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4130 v82 = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4133 pParty->uFallStartY = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4135 if ( v102 && v82 < v109 && (signed int)(pParty->uPartyHeight + v82) >= v109 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4136 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
4137 pParty->vPosition.z = v82 + pParty->uPartyHeight - v109 + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4138 pParty->field_6F0 = v82 + pParty->uPartyHeight - v109 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4141 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4143
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4145
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4147 //----- (0047531C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4148 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
4149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4150 BLVFace *v10; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4151 int v11; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4152 int v12; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4153 int v13; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4154 int v14; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4155 signed __int64 v15; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4156 __int16 v16; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4157 int *v18; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4158 int v19; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4159 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4160 int a9b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4161 int a9a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4162 int a10b; // [sp+3Ch] [bp+24h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4163 signed int a10a; // [sp+3Ch] [bp+24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4164 int a10c; // [sp+3Ch] [bp+24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4165
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4166 v10 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4167 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4168 v19 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4169 if ( a10 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4170 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4171 v11 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4172 a10b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4173 a9b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4174 v12 = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4175 a9a = v11 + a9b + a10b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4176 v13 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4177 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4178 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4179 - a5 * v10->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4180 - v10->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4181 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4182 - a3 * v10->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4183 - a4 * v10->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4184 - a5 * v10->pFacePlane_old.vNormal.z - v10->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4186 a10c = abs(v13) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4187 if ( a10c > abs(v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4188 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4189 LODWORD(v15) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4190 HIDWORD(v15) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4191 v14 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4192 a10a = v15 / a9a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4194 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4196 a10a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4197 v14 = abs(v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4198 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4199 v16 = a4 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4200 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4201 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4202 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4203 HIWORD(a7a) = v16 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4204 if ( !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4205 v10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4206 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4207 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4208 + ((unsigned int)((unsigned __int64)(a10a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4209 - ((unsigned int)(v14 * v10->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4210 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4211 *v18 = a10a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4212 if ( a10a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4213 *v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4214 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4217 //----- (004754BF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4218 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
4219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4220 BLVFace *v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4221 int v12; // ST1C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4222 int v13; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4223 int v14; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4224 int v15; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4225 signed __int64 v16; // qtt@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4226 __int16 v17; // si@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4227 int *v19; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4228 int v20; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4229 int a7a; // [sp+30h] [bp+18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4230 int a1b; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4231 int a1a; // [sp+38h] [bp+20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4232 int a11b; // [sp+40h] [bp+28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4233 signed int a11a; // [sp+40h] [bp+28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4234 int a11c; // [sp+40h] [bp+28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4236 v11 = a9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4237 v19 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4238 v20 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4239 if ( a11 && BYTE3(a9->uAttributes) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4240 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4241 v12 = (unsigned __int64)(a6 * (signed __int64)a9->pFacePlane_old.vNormal.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4242 a11b = (unsigned __int64)(a7 * (signed __int64)a9->pFacePlane_old.vNormal.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4243 a1b = (unsigned __int64)(a8 * (signed __int64)a9->pFacePlane_old.vNormal.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4244 v13 = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4245 a1a = v12 + a1b + a11b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4246 v14 = (a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4247 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4248 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4249 - a5 * v11->pFacePlane_old.vNormal.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4250 - v11->pFacePlane_old.dist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4251 if ( abs((a1 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4252 - a3 * v11->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4253 - a4 * v11->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4254 - a5 * v11->pFacePlane_old.vNormal.z - v11->pFacePlane_old.dist) >= a1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4256 a11c = abs(v14) >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4257 if ( a11c > abs(v13) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4258 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4259 LODWORD(v16) = v14 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4260 HIDWORD(v16) = v14 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4261 v15 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4262 a11a = v16 / a1a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4264 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4266 a11a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4267 v15 = abs(v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4269 v17 = a4 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a7) >> 16) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4270 LOWORD(a7a) = (short)a3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4271 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a6) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4272 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.x) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4273 HIWORD(a7a) = v17 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.y) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4274 if ( !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4275 v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4276 a10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4277 a7a,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4278 (short)a5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4279 + ((unsigned int)((unsigned __int64)(a11a * (signed __int64)a8) >> 16) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4280 - ((unsigned int)(v15 * v11->pFacePlane_old.vNormal.z) >> 16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4281 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4282 *v19 = a11a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4283 if ( a11a >> 16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4284 *v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4285 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4290 //----- (00475665) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4291 signed int __thiscall sub_475665(BLVFace *_this, int a2, __int16 a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4293 unsigned int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4294 Vec3_short_ *v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4295 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4296 int v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4297 signed int v7; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4298 Vec3_short_ *v8; // edx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4299 signed int v9; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4300 int v10; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4301 signed int v11; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4302 Vec3_short_ *v12; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4303 signed int v13; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4304 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4305 int v15; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4306 bool v16; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4307 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4308 signed int v18; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4309 int v19; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4310 signed int v20; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4311 int v21; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4312 signed int v22; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4313 signed __int64 v23; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4314 signed int result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4315 int v25; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4316 int v26; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4317 signed int v27; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4318 signed int v28; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4319 signed int v29; // [sp+30h] [bp+Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4320 signed int v30; // [sp+30h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4321 signed int v31; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4322
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4323 v3 = _this->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4324 if ( BYTE1(v3) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4326 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4327 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4328 v27 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4329 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4331 v4 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4332 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4334 v5 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4335 v6 = 2 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4336 word_720C10_intercepts_xs[2 * v28] = _this->pXInterceptDisplacements[v28] + v4[_this->pVertexIDs[v28]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4337 word_720B40_intercepts_zs[2 * v28] = _this->pYInterceptDisplacements[v5] + v4[_this->pVertexIDs[v5]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4338 word_720C10_intercepts_xs[2 * v28++ + 1] = _this->pXInterceptDisplacements[v5 + 1]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4339 + v4[_this->pVertexIDs[v5 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4340 word_720B40_intercepts_zs[v6 + 1] = _this->pYInterceptDisplacements[v5 + 1] + v4[_this->pVertexIDs[v5 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4342 while ( v28 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4343 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4345 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4347 if ( BYTE1(v3) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4349 v26 = (signed __int16)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4350 v7 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4351 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4352 v27 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4353 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4355 v8 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4356 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4358 v9 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4359 v10 = 2 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4360 word_720C10_intercepts_xs[2 * v29] = _this->pXInterceptDisplacements[v29] + v8[_this->pVertexIDs[v29]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4361 word_720B40_intercepts_zs[2 * v29] = _this->pZInterceptDisplacements[v9] + v8[_this->pVertexIDs[v9]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4362 word_720C10_intercepts_xs[2 * v29++ + 1] = _this->pXInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4363 word_720B40_intercepts_zs[v10 + 1] = _this->pZInterceptDisplacements[v9 + 1] + v8[_this->pVertexIDs[v9 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4364 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4365 while ( v29 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4368 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4370 v26 = SHIWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4371 v11 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4372 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4373 v27 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4374 if ( _this->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4376 v12 = pIndoor->pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4377 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4379 v13 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4380 v14 = 2 * v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4381 word_720C10_intercepts_xs[2 * v30] = _this->pYInterceptDisplacements[v30] + v12[_this->pVertexIDs[v30]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4382 word_720B40_intercepts_zs[2 * v30] = _this->pZInterceptDisplacements[v13] + v12[_this->pVertexIDs[v13]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4383 word_720C10_intercepts_xs[2 * v30++ + 1] = _this->pYInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4384 word_720B40_intercepts_zs[v14 + 1] = _this->pZInterceptDisplacements[v13 + 1] + v12[_this->pVertexIDs[v13 + 1]].z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4385 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4386 while ( v30 < _this->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4390 v15 = 2 * _this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4391 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4392 word_720C10_intercepts_xs[2 * _this->uNumVertices] = word_720C10_intercepts_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4393 word_720B40_intercepts_zs[v15] = word_720B40_intercepts_zs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4394 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4395 v16 = word_720B40_intercepts_zs[0] >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4396 if ( v15 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4397 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4398 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4400 if ( v31 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4401 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4402 v17 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4403 v18 = word_720B40_intercepts_zs[v25 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4404 if ( v16 ^ v18 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4405 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4406 v19 = word_720C10_intercepts_xs[v17 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4407 if ( v19 >= v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4408 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4409 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4410 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4411 v21 = v20 | word_720C10_intercepts_xs[v17] < v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4412 if ( v21 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4414 if ( !v21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4415 || (v22 = v19 - word_720C10_intercepts_xs[v17],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4416 LODWORD(v23) = v22 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4417 HIDWORD(v23) = v22 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4418 word_720C10_intercepts_xs[v17]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4419 + ((signed int)(((unsigned __int64)(v23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4420 / (v18 - word_720B40_intercepts_zs[v17])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4421 * ((v27 - (signed int)word_720B40_intercepts_zs[v17]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4422 + 32768) >> 16) >= v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4423 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4426 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4427 v16 = v18 >= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4428 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4429 while ( v25 < v15 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4430 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4431 if ( v31 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4432 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4433 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4434 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4436
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4437 //----- (004759C9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4438 bool __fastcall sub_4759C9(BLVFace *a1, int a2, int a3, __int16 a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4440 unsigned int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4441 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4442 __int16 v6; // si@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4443 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4444 __int16 v8; // si@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4445 int v9; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4446 __int16 v10; // si@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4447 int v11; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4448 bool v12; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4449 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4450 signed int v14; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4451 int v15; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4452 signed int v16; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4453 int v17; // edi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4454 signed int v18; // ST14_4@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4455 signed __int64 v19; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4456 bool result; // eax@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4457 int v21; // [sp+14h] [bp-10h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4458 signed int v22; // [sp+18h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4459 int v23; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4460 signed int v24; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4461 Vec3_int_ **a4a; // [sp+30h] [bp+Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4462 Vec3_int_ **a4b; // [sp+30h] [bp+Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4463 Vec3_int_ **a4c; // [sp+30h] [bp+Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4464 signed int a4d; // [sp+30h] [bp+Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4465
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4466 v4 = a1->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4467 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4468 if ( BYTE1(v4) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4470 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4471 v24 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4472 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4474 a4a = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4475 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4477 v5 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4478 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4479 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4a)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4480 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
4481 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
4482 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4484 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4486 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4487 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4489 if ( BYTE1(v4) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4491 v23 = (signed __int16)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4492 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4493 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4495 a4b = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4496 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4498 v7 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4499 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pXInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4500 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4b)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4501 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
4502 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
4503 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4505 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4508 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4510 v23 = SHIWORD(a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4511 v24 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4512 if ( a1->uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4514 a4c = &pOutdoor->pBModels[a2].pVertices.pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4515 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4516 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4517 v9 = 2 * v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4518 word_720A70_intercepts_xs_plus_xs[2 * v22] = a1->pYInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4519 word_7209A0_intercepts_ys_plus_ys[2 * v22] = a1->pZInterceptDisplacements[v22] + LOWORD((*a4c)[a1->pVertexIDs[v22]].z);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4520 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
4521 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
4522 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4524 while ( v22 < a1->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4528 v11 = 2 * a1->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4529 a4d = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4530 word_720A70_intercepts_xs_plus_xs[2 * a1->uNumVertices] = word_720A70_intercepts_xs_plus_xs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4531 word_7209A0_intercepts_ys_plus_ys[v11] = word_7209A0_intercepts_ys_plus_ys[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4532 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4533 v12 = word_7209A0_intercepts_ys_plus_ys[0] >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4534 if ( v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4535 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4536 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4538 if ( a4d >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4539 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4540 v13 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4541 v14 = word_7209A0_intercepts_ys_plus_ys[v21 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4542 if ( v12 ^ v14 >= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4544 v15 = word_720A70_intercepts_xs_plus_xs[v13 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4545 if ( v15 >= v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4546 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4547 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4548 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4549 v17 = v16 | word_720A70_intercepts_xs_plus_xs[v13] < v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4550 if ( v17 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4552 if ( !v17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4553 || (v18 = v15 - word_720A70_intercepts_xs_plus_xs[v13],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4554 LODWORD(v19) = v18 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4555 HIDWORD(v19) = v18 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4556 word_720A70_intercepts_xs_plus_xs[v13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4557 + ((signed int)(((unsigned __int64)(v19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4558 / (v14 - word_7209A0_intercepts_ys_plus_ys[v13])
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4559 * ((v24 - (signed int)word_7209A0_intercepts_ys_plus_ys[v13]) << 16)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4560 + 32768) >> 16) >= v23) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4561 ++a4d;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4564 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4565 v12 = v14 >= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4566 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4567 while ( v21 < v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4568 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4569 if ( a4d != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4570 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4571 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4572 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4574
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4575 //----- (00475D85) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4576 bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, BLVFace *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4578 BLVFace *v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4579 int v5; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4580 int v6; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4581 int v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4582 int v8; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4583 signed int v9; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4584 signed __int64 v10; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4585 Vec3_int_ *v11; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4586 int v12; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4587 Vec3_int_ *v14; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4588 Vec3_int_ *v15; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4589 int v16; // [sp+18h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4590 int v17; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4591 int a4b; // [sp+30h] [bp+Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4592 int a4c; // [sp+30h] [bp+Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4593 signed int a4a; // [sp+30h] [bp+Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4594
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4595 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4596 v15 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4597 v14 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4598 if ( BYTE3(a4->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4599 || (v5 = (unsigned __int64)(a2->x * (signed __int64)a4->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4600 a4b = (unsigned __int64)(a2->y * (signed __int64)a4->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4601 v6 = (unsigned __int64)(a2->z * (signed __int64)v4->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4602 v7 = v5 + v6 + a4b,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4603 (v16 = v5 + v6 + a4b) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4604 || v7 > 0 && !(v4->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4605 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4606 v8 = v4->pFacePlane_old.vNormal.z * a1->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4607 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
4608 if ( v7 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4610 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
4611 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4613 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4615 if ( v9 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4616 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4618 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
4619 if ( a4c > abs(v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4620 || (LODWORD(v10) = v9 << 16, HIDWORD(v10) = v9 >> 16, a4a = v10 / v16, v17 = v10 / v16, v17 > *a3 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4621 || (v11 = v14,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4622 LOWORD(v12) = LOWORD(v14->x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4623 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->x) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4624 HIWORD(v12) = LOWORD(v11->y)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4625 + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->y) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4626 !sub_475665(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4627 v4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4628 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4629 LOWORD(v11->z) + (((unsigned int)((unsigned __int64)(v17 * (signed __int64)v15->z) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4630 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4631 *a3 = a4a >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4632 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4633 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4634
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4635 //----- (00475F30) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4636 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
4637 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4638 BLVFace *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4639 int v10; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4640 int v11; // ST28_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4641 int v12; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4642 char v13; // zf@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4643 int v14; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4644 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4645 signed int v16; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4646 int v17; // ST20_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4647 signed __int64 v18; // qtt@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4648 int v19; // ST14_4@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4649 int *v21; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4650 int v22; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4651 int v23; // [sp+1Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4652 signed int v24; // [sp+20h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4653
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4654 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4655 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4656 if ( BYTE3(a2->uAttributes) & 0x20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4657 || (v10 = (unsigned __int64)(a6 * (signed __int64)a2->pFacePlane_old.vNormal.x) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4658 v11 = (unsigned __int64)(a7 * (signed __int64)a2->pFacePlane_old.vNormal.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4659 v12 = (unsigned __int64)(a8 * (signed __int64)a2->pFacePlane_old.vNormal.z) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4660 v13 = v10 + v12 + v11 == 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4661 v14 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4662 v22 = v10 + v12 + v11,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4663 v13)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4664 || v14 > 0 && !(a2->uAttributes & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4665 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4666 v15 = a4 * a2->pFacePlane_old.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4667 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
4668 if ( v14 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4670 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
4671 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4673 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4675 if ( v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4676 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4678 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
4679 if ( v17 > abs(v14)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4680 || (LODWORD(v18) = v16 << 16, HIDWORD(v18) = v16 >> 16, v24 = v18 / v22, v23 = v18 / v22, v23 > *v21 << 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4681 || (LOWORD(v19) = a3 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a6) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4682 HIWORD(v19) = a4 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a7) >> 16) + 32768) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4683 !sub_4759C9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4684 v9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4685 a9,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4686 v19,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4687 a5 + (((unsigned int)((unsigned __int64)(v23 * (signed __int64)a8) >> 16) + 32768) >> 16))) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4688 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4689 *v21 = v24 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4690 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4692
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4693
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4694
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4695
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4696
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4697 //----- (004760D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4698 PartyAction ActionQueue::Next()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4699 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4700 if (!uNumActions)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4701 return PARTY_INVALID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4702
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4703 auto result = pActions[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4704 for (unsigned int i = 0; i < uNumActions - 1; ++i)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4705 pActions[i] = pActions[i + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4706 --uNumActions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4707
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4708 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4710
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4711 //----- (00476387) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4712 bool __cdecl sub_476387()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4714 return (pNPCStats->pNewNPCData[57].uFlags & 0x80) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4716
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4717 //----- (00476395) --------------------------------------------------------
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
4718 //0x26 Wizard eye at skill level 2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4719 bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4721 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4722 signed int v2; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4723 char *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4724
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4725 if ( bNoNPCHiring == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4726 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4727 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4728 if ( (signed int)pNPCStats->uNumNewNPCs <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4730 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4731 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4732 if ( pParty->pHirelings[0].uProfession != uProfession )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4734 LOBYTE(result) = pParty->pHirelings[1].uProfession == uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4735 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4736 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4738 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4740 v3 = (char *)&pNPCStats->pNewNPCData[0].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4741 while ( *((int *)v3 + 4) != uProfession || !(*v3 & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4742 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4743 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4744 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4745 if ( v2 >= (signed int)pNPCStats->uNumNewNPCs )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4746 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4748 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4750 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4751 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4753 // 6BE3C5: using guessed type char bNoNPCHiring;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4754
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4755 //----- (004763E0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4756 void __cdecl InitializeAwards()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4757 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4758 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4759 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4760 char v2; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4761 char *v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4762 int v4; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4763 signed int v5; // [sp+Ch] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4764 char *v6; // [sp+10h] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4765 Award *v7; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4766
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4767 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4768 if ( pAwardsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4769 pAllocator->FreeChunk(pAwardsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4770 pAwardsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4771 pAwardsTXT_Raw = (char *)pEvents_LOD->LoadRaw("awards.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4772 strtok(pAwardsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4773 v7 = pAwards;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4774 for (uint i = 0; i < 104; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4776 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4777 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4778 v5 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4779 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4781 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4782 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4783 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4784 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4785 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4786 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4788 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4789 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4790 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4791 v2 = v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4792 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4793 while ( v2 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4795 v4 = (int)&v1[(int)v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4796 if ( v1[(int)v3] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4797 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4798 *(char *)v4 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4799 if ( v3 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4801 v5 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4803 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4805 if ( v6 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4807 v7->pText = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4809 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4811 if ( v6 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4812 v7->uSort = atoi(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4815 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4816 v1 = (char *)(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4818 while ( (signed int)(v6 - 1) <= 2 && (char *)v5 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4819 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4820 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4821 //while ( (signed int)v7 < (signed int)&dword_7241C8 );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4822 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4823 // 7241C8: using guessed type int dword_7241C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4824
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4825 //----- (004764C2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4826 void __cdecl InitializeScrolls()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4828 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4829 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4830 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4831 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4832 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4833 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4834 const char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4835 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4836
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4837 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4838 if ( pScrollsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4839 pAllocator->FreeChunk(pScrollsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4840 pScrollsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4841 pScrollsTXT_Raw = (char *)pEvents_LOD->LoadRaw("scroll.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4842 strtok(pScrollsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4843 v6 = pScrolls;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4844 for (uint i = 0; i < 82; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4846 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4847 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4848 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4849 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4851 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4852 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4853 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4855 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4856 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4857 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4858 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4859 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4860 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4861 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4863 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4865 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4866 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4867 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4868 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4869 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4871 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4873 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4875 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4876 *v6 = RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4878 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4879 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4881 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4882 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4883 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4884 //while ( (signed int)v6 < (signed int)dword_723E80_award_related );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4885 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4886
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4887
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4888 //----- (00476590) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4889 void __cdecl InitializeMerchants()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4891 char *v0; // ebx@1
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4892 //char **v1; // edi@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4893 char *v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4894 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4895 char *v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4896 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4897 signed int v6; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4898 char *v7; // [sp+10h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4899
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4900 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4901 if ( pMerchantsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4902 pAllocator->FreeChunk(pMerchantsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4903 pMerchantsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4904 pMerchantsTXT_Raw = (char *)pEvents_LOD->LoadRaw("merchant.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4905 strtok(pMerchantsTXT_Raw, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4906 //v1 = (char **)pMerchantsRepairPhrases;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4907 for (uint i = 0; i < 7; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4909 v7 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4910 v6 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4911 v2 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4912 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4913 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4914 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4915 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4916 if ( *v2 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4918 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4919 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4921 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4922 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4923 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4924 v3 = v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4925 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4926 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4927 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4928 v5 = (int)&v2[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4929 if ( v2[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4930 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4931 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4932 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4934 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4936 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4938 if ( v7 == (char *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4939 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4940 pMerchantsBuyPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4942 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4944 if ( v7 == (char *)2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4945 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4946 pMerchantsSellPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4947 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4948 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4950 if ( v7 == (char *)3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4951 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4952 pMerchantsRepairPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4953 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4954 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4955 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4956 if ( v7 - 3 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4957 pMerchantsIdentifyPhrases[i] = RemoveQuotes(v2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4959 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4962 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4963 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4965 while ( (signed int)(v7 - 1) <= 4 && (char *)v6 == v0 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4966 //++v1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4967 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4968 //while ( (signed int)v1 < (signed int)pMerchantsIdentifyPhrases );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4970
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4971 //----- (00476682) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4972 void __cdecl InitializeTransitions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4974 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4975 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4976 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4977 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4978 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4979 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4980 char **v6; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4981 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4982
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4983 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4984 if ( pTransitionsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4985 pAllocator->FreeChunk(pTransitionsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4986 pTransitionsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4987 pTransitionsTXT_Raw = (char *)pEvents_LOD->LoadRaw("trans.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4988 strtok(pTransitionsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4989 v6 = pTransitionStrings;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
4990 for (uint i = 0; i < 464; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4992 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4993 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4994 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4995 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4997 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4998 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4999 if ( *v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5001 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5002 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5004 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5005 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5006 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5007 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5009 while ( v3 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5011 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5012 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5013 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5014 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5015 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5017 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5019 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5021 if ( v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5022 *v6 = (char *)RemoveQuotes(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5023 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5024 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5025 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5026 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5027 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5028 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5029 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5030 //while ( (signed int)v6 < (signed int)"awards.txt" );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5033 //----- (00476750) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5034 void __cdecl InitializeAutonotes()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5036 char *v0; // ebp@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5037 int v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5038 char *v2; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5039 char v3; // cl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5040 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5041 int v5; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5042 signed int v6; // [sp+0h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5043
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5044 if ( pAutonoteTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5045 pAllocator->FreeChunk(pAutonoteTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5046 pAutonoteTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5047 pAutonoteTXT_Raw = (char *)pEvents_LOD->LoadRaw("autonote.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5048 strtok(pAutonoteTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5049 v0 = (char *)&stru_723720[0].eType;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5050 for (uint i = 0; i < 195; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5051 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5052 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5053 v2 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5054 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5055 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5057 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5058 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5059 while ( v3 != 9 && v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5060 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5061 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5062 v3 = v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5064 v5 = (int)&v2[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5065 if ( !v2[v4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5066 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5067 *(char *)v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5068 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5070 if ( v1 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5071 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5072 *((int *)v0 - 1) = (int)RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5074 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5076 if ( v1 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5078 if ( _strcmpi(v2, "potion") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5080 if ( _strcmpi(v2, "stat") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5081 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5082 if ( _strcmpi(v2, "seer") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5084 if ( _strcmpi(v2, "obelisk") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5085 *(int *)v0 = 5 - (_strcmpi(v2, "teacher") != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5086 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5087 *(int *)v0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5088 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5089 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5091 *(int *)v0 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5094 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5096 *(int *)v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5099 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5101 *(int *)v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5103 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5104 }
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 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5110 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5111 v2 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5112 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5113 while ( v1 - 1 <= 2 && !v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5114 v0 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5115 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5116 //while ( (signed int)v0 < (signed int)&pScrolls[1] );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5117 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5118
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5119
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5120 //----- (004768A9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5121 void __cdecl InitializeQuests()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5123 char *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5124 char *v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5125 int v2; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5126 char v3; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5127 char *v4; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5128 int v5; // esi@9
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5129 //const char **v6; // [sp+10h] [bp-8h]@3
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5130 signed int v7; // [sp+14h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5131
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5132 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5133 if ( pQuestsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5134 pAllocator->FreeChunk(pQuestsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5135 pQuestsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5136 pQuestsTXT_Raw = (char *)pEvents_LOD->LoadRaw("quests.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5137 strtok(pQuestsTXT_Raw, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5138
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5139 //v6 = pQuestTable;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5140 for (uint i = 0; i < 512; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5141 //do
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5143 v1 = strtok(v0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5144 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5145 v7 = (signed int)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5146 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5147 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5148 v3 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5149 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5150 if ( *v1 != '\t' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5152 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5153 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5154 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5155 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5156 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5157 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5158 v3 = v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5159 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5160 while ( v3 != '\t' );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5162 v5 = (int)&v1[(int)v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5163 if ( v1[(int)v4] == (char)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5164 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5165 *(char *)v5 = (char)v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5166 if ( v4 == v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5168 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5169 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5170 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5172 if ( v2 == 1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5173 pQuestTable[i] = RemoveQuotes(v1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5175 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5176 v1 = (char *)(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5178 while ( v2 - 1 <= 1 && (char *)v7 == v0 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5179 //++v6;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5180 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5181 //while ( (signed int)v6 < (signed int)&unk_723714 );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5183
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5185
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5186 //----- (00476977) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5187 void NPCStats::Initialize2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5189 char *v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5190 char v5; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5191 char *v6; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5192 int v7; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5193 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5194 char v10; // dl@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5195 char *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5196 int v12; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5197 char *v14; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5198 char v15; // dl@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5199 int v16; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5200 int v17; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5201 char v18; // zf@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5202 NPCStats_stru0 *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5203 signed int v20; // edx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5204 signed int v21; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5205 char *v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5206 char *v23; // [sp+10h] [bp-10h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5207 char *v25; // [sp+14h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5208 char *v26; // [sp+14h] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5209 signed int v27; // [sp+14h] [bp-Ch]@39
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5210 //signed int v28; // [sp+18h] [bp-8h]@3
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5211 //signed int v29; // [sp+18h] [bp-8h]@20
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5212 signed int v30; // [sp+18h] [bp-8h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5213 char *v31; // [sp+1Ch] [bp-4h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5214
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5215 //v1 = this;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5216 //v2 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5217 if (pNPCTextTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5218 pAllocator->FreeChunk(pNPCTextTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5219
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5220 //v3 = (char *)pEvents_LOD->LoadRaw("npctext.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5221 pNPCTextTXT_Raw = (char *)pEvents_LOD->LoadRaw("npctext.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5222 strtok(pNPCTextTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5223
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5224 for (uint i = 0; i < 789; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5225 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5226 v4 = strtok(nullptr, "\r") + 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5227 v22 = nullptr;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5228 v25 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5229 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5230 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5231 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5232 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5233 if ( *v4 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5235 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5237 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5238 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5239 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5240 v5 = v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5241 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5242 while ( v5 != 9 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5243 //v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5245 v7 = (int)&v4[(int)v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5246 if ( !v4[(int)v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5247 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5248 *(char *)v7 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5249 if ( v6 == nullptr )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5251 v25 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5253 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5255 if ( v22 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5256 pNPCTopics[i].pText = RemoveQuotes(v4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5258 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5259 v4 = (char *)(v7 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5260 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5261 while ( (signed int)(v22 - 1) <= 1 && v25 == nullptr );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5262 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5263
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5264 if (pNPCTopicTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5265 pAllocator->FreeChunk(pNPCTopicTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5266
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5267 //v8 = (char *)pEvents_LOD->LoadRaw("npctopic.txt", (int)v2);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5268 pNPCTopicTXT_Raw = (char *)pEvents_LOD->LoadRaw("npctopic.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5269 strtok(pNPCTopicTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5270
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5271 for (uint i = 0; i < 579; ++i)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5272 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5273 v9 = strtok(nullptr, "\r") + 1;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5274 v23 = nullptr;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5275 v26 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5276 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5277 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5278 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5279 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5280 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5282 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5284 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5285 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5286 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5287 v10 = v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5289 while ( v10 != 9 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5290 //v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5292 v12 = (int)&v9[(int)v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5293 if ( !v9[(int)v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5294 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5295 *(char *)v12 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5296 if ( v11 == nullptr )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5298 v26 = (char *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5300 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5302 if ( v23 == (char *)1 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5303 pNPCTopics[i].pTopic = RemoveQuotes(v9);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5305 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5306 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5307 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5308 while ( (signed int)(v23 - 1) <= 1 && v26 == nullptr );
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5309 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5310
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5311 if (pNPCDistTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5312 pAllocator->FreeChunk(pNPCDistTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5313
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5314 //v13 = (char *)pEvents_LOD->LoadRaw("npcdist.txt", (int)v2);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5315 pNPCDistTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcdist.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5316 strtok(pNPCDistTXT_Raw, "\r");
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5317 strtok(nullptr, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5318 v30 = 1;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5319 v31 = &array_16544[0].field_4[1];
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5320
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5321 char *v2 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5322 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5323 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5324 v14 = strtok(nullptr, "\r") + 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5325 v27 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5326 char *v24 = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5327 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5329 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5330 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5331 if ( *v14 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5332 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5333 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5334 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5335 if ( !v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5336 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5337 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5338 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5340 while ( v15 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5341 v2 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5343 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5344 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5345 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5346 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5347 if ( !v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5349 v27 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5350 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5352 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5353 if ( (signed int)v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5355 if ( (signed int)v2 < 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5356 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5357 array_16544[(int)v2].field_4[v30] = atoi(v14);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5358 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5360 v18 = v2 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5362 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5363 *v31 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5364 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5365 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5366 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5367 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5368 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5369 while ( (signed int)(v2 - 1) <= 77 && !v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5370 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5371 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5372 if ( v30 < 59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5373 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5374 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5375 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5376 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5377 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5378 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5379 v19 = array_16544;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5380 v20 = 77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5381 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5383 v19->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5384 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5385 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5386 v19->field_0 += v19->field_4[v21++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5387 while ( v21 < 59 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5388 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5389 --v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5391 while ( v20 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5392
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5393 if (pNPCDistTXT_Raw)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5394 {
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5395 pAllocator->FreeChunk(pNPCDistTXT_Raw);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5396 pNPCDistTXT_Raw = nullptr;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5399
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5400 //----- (00476C60) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5401 void NPCStats::_476C60()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5402 {
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5403 for (uint i = 1; i < uNumNewNPCs; ++i)
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5404 pNewNPCData[i].pName = pNPCNames2[i - 1];
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5405
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5406 if (pParty->pHirelings[0].pName)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5407 pParty->pHirelings[0].pName = pParty->pHireling1Name;
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
5408 if (pParty->pHirelings[1].pName)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5409 pParty->pHirelings[1].pName = pParty->pHireling2Name;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5411
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5412 //----- (00476CB5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5413 void NPCStats::Initialize1()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5414 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5415 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5416 char *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5417 char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5418 char *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5419 char v5; // dl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5420 int v6; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5421 char *v7; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5422 char *v8; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5423 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5424 char v10; // dl@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5425 int v11; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5426 int v12; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5427 char *v13; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5428 char *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5429 char v15; // dl@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5430 int v16; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5431 int v17; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5432 char *v18; // eax@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5433 char *v19; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5434 char v20; // cl@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5435 int v21; // edi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5436 int v22; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5437 int v23; // [sp+Ch] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5438 signed int v24; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5439 signed int v25; // [sp+10h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5440 signed int v26; // [sp+10h] [bp-10h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5441 signed int v27; // [sp+10h] [bp-10h]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5442 char *Str; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5443 NPCGreeting *pGreetings; // [sp+14h] [bp-Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5444 unsigned __int16 *pGroups; // [sp+14h] [bp-Ch]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5445 char **pCatchPhrase; // [sp+14h] [bp-Ch]@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5446 signed int v32; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5447 signed int v33; // [sp+18h] [bp-8h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5448 signed int v34; // [sp+18h] [bp-8h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5449 signed int v35; // [sp+18h] [bp-8h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5450 signed int v36; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5451 signed int v37; // [sp+1Ch] [bp-4h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5452 signed int v38; // [sp+1Ch] [bp-4h]@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5453 signed int v39; // [sp+1Ch] [bp-4h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5454
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5455 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5456 v2 = (char *)pEvents_LOD->LoadRaw("npcdata.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5457 v1->pNPCDataTXT_Raw = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5458 strtok(v2, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5459 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5460 v3 = (char *)&v1->pNPCData[1].house;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5461 Str = (char *)v1->pNPCNames2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5462 v24 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5463 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5465 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5466 v4 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5467 v36 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5468 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5470 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5471 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5472 while ( v5 != 9 && v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5474 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5475 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5477 v23 = (int)&v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5478 if ( !v4[v6] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5479 v32 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5480 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5481 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5483 switch ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5485 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5486 v7 = RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5487 *((int *)v3 - 5) = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5488 *(int *)Str = (int)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5489 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5490 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5491 *((int *)v3 - 4) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5492 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5493 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5494 *(int *)v3 = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5495 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5496 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5497 *((int *)v3 + 1) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5498 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5499 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5500 *((int *)v3 + 2) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5501 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5502 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5503 *((int *)v3 + 3) = *v4 == 121;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5504 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5505 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5506 *((int *)v3 + 5) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5507 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5508 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5509 *((int *)v3 + 6) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5510 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5511 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5512 *((int *)v3 + 7) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5513 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5514 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5515 *((int *)v3 + 8) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5516 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5517 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5518 *((int *)v3 + 9) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5519 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5520 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5521 *((int *)v3 + 10) = atoi(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5522 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5523 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5524 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5527 ++v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5528 v4 = (char *)(v23 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5529 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5530 while ( v36 + 1 <= 15 && !v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5531 Str += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5532 v3 += 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5533 --v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5535 while ( v24 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5536 v1->uNumNewNPCs = 501;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5537 v8 = (char *)pEvents_LOD->LoadRaw("npcgreet.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5538 v1->pNPCGreetTXT_Raw = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5539 strtok(v8, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5540 pGreetings = v1->pNPCGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5541 v25 = 205;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5542 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5544 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5545 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5546 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5547 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5548 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5549 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5550 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5551 while ( v10 != 9 && v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5553 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5554 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5556 v12 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5557 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5558 v33 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5559 *(char *)v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5560 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5562 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5564 pGreetings->pGreeting1 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5566 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5568 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5569 pGreetings->pGreeting2 = (char *)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5571 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5572 ++v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5573 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5575 while ( v37 <= 2 && !v33 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5576 ++pGreetings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5577 --v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5579 while ( v25 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5580 v13 = (char *)pEvents_LOD->LoadRaw("npcgroup.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5581 v1->pNCPGroupTXT_Raw = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5582 strtok(v13, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5583 pGroups = v1->pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5584 v26 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5585 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5587 v14 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5588 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5589 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5590 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5591 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5592 v15 = *v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5593 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5594 while ( v15 != 9 && v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5596 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5597 v15 = v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5598 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5599 v17 = (int)&v14[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5600 if ( !v14[v16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5601 v34 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5602 *(char *)v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5603 if ( v16 && v38 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5604 *pGroups = atoi(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5605 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5606 v14 = (char *)(v17 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5607 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5608 while ( v38 <= 1 && !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5609 ++pGroups;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5610 --v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5611 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5612 while ( v26 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5613 v18 = (char *)pEvents_LOD->LoadRaw("npcnews.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5614 v1->pNPCNewsTXT_Raw = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5615 strtok(v18, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5616 pCatchPhrase = v1->pCatchPhrases;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5617 v27 = 51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5618 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5619 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5620 v19 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5621 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5622 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5623 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5625 v20 = *v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5626 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5627 while ( v20 != 9 && v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5629 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5630 v20 = v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5632 v22 = (int)&v19[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5633 if ( !v19[v21] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5634 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5635 *(char *)v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5636 if ( v21 && v39 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5637 *pCatchPhrase = (char *)RemoveQuotes(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5638 ++v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5639 v19 = (char *)(v22 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5641 while ( v39 <= 1 && !v35 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5642 ++pCatchPhrase;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5643 --v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5645 while ( v27 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5647
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5648 //----- (0047702F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5649 void NPCStats::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5650 {
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5651 //NPCStats *v1; // edi@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5652 char *v2; // ebx@1
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5653 //char *v3; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5654 char *v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5655 char v5; // al@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5656 int v6; // ecx@4
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5657 //char *v7; // eax@18
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5658 char *v8; // ebx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5659 char *v9; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5660 char v10; // dl@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5661 int v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5662 char v12; // zf@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5663 signed int v13; // [sp+Ch] [bp-14h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5664 int v14; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5665 int v15; // [sp+10h] [bp-10h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5666 char *v16; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5667 signed int v17; // [sp+14h] [bp-Ch]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5668 unsigned int v18; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5669 char *v19; // [sp+18h] [bp-8h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5670 signed int v20; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5671 signed int v21; // [sp+1Ch] [bp-4h]@19
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5672 //v1 = this;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5673
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5674 Initialize1();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5675 Initialize2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5676
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5677 InitializeQuests();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5678 InitializeAutonotes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5679 InitializeAwards();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5680 InitializeTransitions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5681 InitializeMerchants();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5682 InitializeScrolls();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5683 v2 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5684 field_17FC0 = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5685 pNPCNamesTXT_Raw = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5686 //v3 = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5687 pNPCNamesTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcnames.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5688 strtok(pNPCNamesTXT_Raw, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5689 v18 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5690 v16 = (char *)pNPCNames;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5691 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5693 v4 = strtok(v2, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5694 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5695 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5696 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5697 v5 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5698 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5699 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5700 if ( *v4 == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5701 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5702 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5704 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5705 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5706 if ( v5 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5707 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5708 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5709 v14 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5710 v5 = v4[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5711 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5712 while ( v5 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5713 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5715 v4[v6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5716 if ( v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5718 if ( v20 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5719 *((int *)v16 + 1) = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5720 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5721 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5723 *(int *)v16 = (int)RemoveQuotes(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5726 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5728 LABEL_45:
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5729 if ( v20 == 1 && !uNumNPCNames[1] )
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5730 uNumNPCNames[1] = v18;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5731 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5732 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5733 v4 += v14 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5734 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5735 while ( v20 <= 1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5736 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5737 v16 += 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5738 if ( (signed int)v18 >= 540 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5739 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5740 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5741 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5742 pNPCProfTXT_Raw = 0;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5743 uNumNPCNames[0] = v18;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5744 //v7 = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5745 pNPCProfTXT_Raw = (char *)pEvents_LOD->LoadRaw("npcprof.txt", 0);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5746 strtok(pNPCProfTXT_Raw, "\r");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5747 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5748 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5749 strtok(0, "\r");
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5750 v8 = (char *)&pProfessions[0].pJoinText;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5751 v19 = (char *)&pProfessions[0].pJoinText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5752 v13 = 58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5753 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5755 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5756 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5757 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5758 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5759 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5760 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5761 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5762 if ( *v9 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5764 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5766 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5767 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5768 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5769 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5770 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5771 while ( v10 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5772 v8 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5774 v15 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5775 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5776 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5777 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5778 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5780 switch ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5782 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5783 *((int *)v8 - 3) = atoi(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5784 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5785 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5786 *((int *)v8 - 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5787 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5788 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5789 *((int *)v8 - 2) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5790 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5791 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5792 *(int *)v8 = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5793 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5794 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5795 *((int *)v8 + 1) = (int)RemoveQuotes(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5796 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5799 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5801 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5802 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5804 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5805 v9 = (char *)(v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5807 while ( v21 <= 6 && !v17 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5808 v8 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5809 v12 = v13-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5810 v19 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5812 while ( !v12 );
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
5813 uNumNPCProfessions = 59;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5815
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5816 //----- (00477266) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5817 void NPCStats::Release()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5819 NPCStats *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5820 void *v2; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5821 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5822
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5823 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5824 pAllocator->FreeChunk(this->pNPCTopicTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5825 v2 = v1->pNPCTextTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5826 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5827 pAllocator->FreeChunk(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5828 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5829 pAllocator->FreeChunk(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5830 v1->pNPCNewsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5831 pAllocator->FreeChunk(v1->pNPCProfTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5832 v1->pNPCProfTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5833 pAllocator->FreeChunk(v1->pNPCNamesTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5834 v1->pNPCNamesTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5835 pAllocator->FreeChunk(v1->pNPCDataTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5836 v1->pNPCDataTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5837 pAllocator->FreeChunk(v1->pNPCDistTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5838 v1->pNPCDistTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5839 v3 = (int)&v1->pNPCGreetTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5840 pAllocator->FreeChunk(v1->pNPCGreetTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5841 v1 = (NPCStats *)((char *)v1 + 98296);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5842 *(int *)v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5843 pAllocator->FreeChunk(v1->pNPCData[0].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5844 v1->pNPCData[0].pName = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5846
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5847 //----- (0047730C) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5848 int __fastcall const_1(int a1, int)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5850 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5852 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5853
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5854 //----- (0047732C) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5855 bool NPCStats::InitializeAdditionalNPCs(NPCData *a2, int a3, int a4, int a5)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5856 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5857 //NPCStats *v5; // ebx@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5858 signed __int64 v6; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5859 int v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5860 int v8; // edx@1
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5861 NPCData *v9; // edi@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5862 int v10; // eax@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5863 //int v11; // eax@23
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5864 int v12; // ecx@23
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5865 int v13; // edx@28
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5866 int v14; // esi@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5867 int v15; // edx@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5868 int v16; // ecx@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5869 int v17; // eax@37
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5870 int v18; // edx@37
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5871 signed int result; // eax@39
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5872 int v20; // [sp+Ch] [bp-Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5873 signed int v21; // [sp+10h] [bp-8h]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5874 signed int v22; // [sp+14h] [bp-4h]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5875 int v23; // [sp+24h] [bp+Ch]@1
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5876
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5877
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5878 v23 = a3 - 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5879 //v5 = this;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5880 v6 = (signed __int64)((double)v23 * -0.33333334);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5881 v7 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 28];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5882 v20 = (unsigned __int8)byte_4E8394[-(_DWORD)v6 + 116];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5883 v8 = rand() % uNumNPCNames[v7];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5884 v9 = a2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5885 a2->uSex = v7;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5886 a2->pName = pNPCNames[v8][v7];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5887 v10 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5888 v22 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5889 v21 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5890
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5891 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5892 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5893 if ( v20 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5894 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5895 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5896 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5897 v23 = 2;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5898 a2 = (NPCData *)100;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5899 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5900 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5901 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5902 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5903 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5904 v23 = 201;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5905 a2 = (NPCData *)250;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5906 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5907 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5908 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5909 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5910 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5911 switch ( v20 - v10 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5912 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5913 case 1:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5914 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5915 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5916 v23 = 400;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5917 a2 = (NPCData *)430;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5919 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5920 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5921 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5922 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5923 v23 = 460;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5924 a2 = (NPCData *)490;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5925 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5927 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5928 case 2:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5929 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5930 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5931 v23 = 500;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5932 a2 = (NPCData *)520;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5934 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5935 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5936 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5937 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5938 v23 = 530;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5939 a2 = (NPCData *)550;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5940 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5942 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5943 case 3:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5944 if ( v7 == v10 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5945 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5946 v23 = 300;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5947 a2 = (NPCData *)330;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5949 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5950 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5951 if ( v7 - v10 == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5952 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5953 v23 = 360;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5954 a2 = (NPCData *)387;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5955 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5957 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5959 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5960 v12 = v23 + rand() % ((int)a2 - v23 + 1);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5961 if ( const_1(v12, v7) == 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5962 v21 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5963 ++v22;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5964 if ( v22 >= 4 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5965 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5966 v12 = v23;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5967 v21 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5968 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5969 if ( v21 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5970 break;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5971 v10 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5972 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5973
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5974 v9->uPortraitID = v12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5975 v9->uFlags = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5976 v9->fame = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5977 v13 = rand() % 100 + 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5978
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5979 if ( v13 >= 60 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5980 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5981 if ( v13 >= 90 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5982 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5983 if ( v13 >= 95 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5984 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5985 if ( v13 >= 98 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5986 v9->rep = -600;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5987 else
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5988 v9->rep = 400;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5989 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5990 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5991 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5992 v9->rep = -300;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5993 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5994 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5995 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5996 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5997 v9->rep = 200;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5998 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
5999 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6000 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6001 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6002 v9->rep = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6003 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6004
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6005 //v14 = (int)((char *)v5 + 64 * a5);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6006 //v15 = rand() % *(_DWORD *)(v14 + 91460);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6007 v15 = rand() % array_16544[a5].field_0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6008 v16 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6009 v17 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6010 v18 = v15 + 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6011
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6012 if ( v18 > 0 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6013 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6014 do
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6015 //v14 += *(char *)(v14 + v17++ + 0x16548);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6016 v16 += array_16544[a5].field_4[v17++];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6017 while ( v16 < v18 );
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->uProfession = v17 - 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6020 v9->house = a4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6021 v9->field_24 = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6022 v9->joins = 1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
6023 return true;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6025 // 47730C: using guessed type int __stdcall const_1(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6026
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6027 //----- (0047752B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6028 int __cdecl GetPartyReputation()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6030 DDM_DLV_Header *v0; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6031 signed int v1; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6033 v0 = &pOutdoor->ddm;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6034 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6035 v0 = &pIndoor->dlv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6036 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6037 if ( CheckHiredNPCSpeciality(0x2Du) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6038 v1 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6039 if ( CheckHiredNPCSpeciality(0x33u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6040 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6041 if ( CheckHiredNPCSpeciality(0x30u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6042 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6043 if ( CheckHiredNPCSpeciality(0x32u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6044 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6045 if ( CheckHiredNPCSpeciality(0x34u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6046 v1 += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6047 return v1 + v0->uReputation;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6048 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6049
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6050
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6051
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6052
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6053
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6054 //----- (004775ED) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6055 int stru6_stru1_indoor_sw_billboard::_4775ED(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6057 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6058 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6059 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6060 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6061 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6062 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6063 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6064 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6065 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6066 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6067 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6068 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6069 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6070 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6071 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6072 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6073 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6074 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6075 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6076 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6077 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6078 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6079 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6080 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6081 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6082 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6083 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6084 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6085 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6086 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6087 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6088 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6089 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6090 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6091 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6092 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6093 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6094 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6095 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6096
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6097 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6098 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6099 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6100 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6101 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6102 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6103 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6104 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6105 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6106 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6107 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6109 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6110 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6111 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6112 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6114 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6115 if ( *(float *)(v4 - 15) <= (double)a2 && *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6116 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6117 if ( *(float *)v5 <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6118 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6119 if ( *(float *)(v4 + 1) <= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6121 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6122 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6123 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6124 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6125 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6126 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6127 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6128 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6129 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6130 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6131 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6132 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6133 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6134 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6135 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6136 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6137 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6138 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6139 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6140 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6141 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6142 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6143 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6144 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6145 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6146 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6147 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6148 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6149 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6150 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6151 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6152 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6154 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6155 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6156 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6157 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6158 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6159 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6160 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6161 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6162 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6163 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6164 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6165 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6166 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6167 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6168 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6169 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6170 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6172 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6173 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6174 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6175 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6176 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6177 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6178 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6179 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6180 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6181 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6182 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6183 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6184 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6185 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6186 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6187 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6188 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6189 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6190 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6191 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6192 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6193 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6195 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6196 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6197 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6198 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6201 //----- (00477927) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6202 int stru6_stru1_indoor_sw_billboard::_477927(float a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6204 char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6205 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6206 char *v4; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6207 char *v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6208 double v6; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6209 signed __int64 v7; // ST84_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6210 double v8; // ST0C_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6211 int v9; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6212 double v10; // ST44_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6213 int v11; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6214 double v12; // ST34_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6215 int v13; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6216 double v14; // ST14_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6217 double v15; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6218 unsigned int v16; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6219 signed __int64 v17; // ST64_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6220 double v18; // ST24_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6221 int v19; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6222 double v20; // ST3C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6223 int v21; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6224 double v22; // ST2C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6225 int v23; // ST9C_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6226 double v24; // ST1C_8@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6227 int *v25; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6228 int v26; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6229 int *v27; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6230 int v28; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6231 int result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6232 __int64 v30; // [sp+A8h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6233 float v31; // [sp+B0h] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6234 float v32; // [sp+B4h] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6235 int v33; // [sp+B8h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6236 int v34; // [sp+BCh] [bp-1Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6237 stru6_stru1_indoor_sw_billboard *v35; // [sp+C0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6238 float v36; // [sp+C4h] [bp-14h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6239 int v37; // [sp+C8h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6240 int v38; // [sp+CCh] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6241 float v39; // [sp+D0h] [bp-8h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6242 int *v40; // [sp+D4h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6244 v2 = (char *)&this->field_14[4 * this->field_10 + 20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6245 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6246 *(int *)v2 = this->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6247 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6248 *(int *)v2 = this->field_14[21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6249 v2 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6250 *(int *)v2 = this->field_14[22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6251 *((int *)v2 + 1) = this->field_14[23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6252 v3 = this->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6253 v35 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6254 if ( v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6256 v40 = &this->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6257 v4 = (char *)&this->field_14[23] + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6258 v34 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6259 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6260 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6261 v5 = v4 - 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6262 if ( *(float *)(v4 - 15) >= (double)a2 && *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6263 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6264 if ( *(float *)v5 >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6265 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6266 if ( *(float *)(v4 + 1) >= (double)a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6268 v15 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6269 v16 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6270 HIDWORD(v30) = LODWORD(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6271 v17 = (unsigned __int8)v4[16] - v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6272 v36 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6273 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v15 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6274 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v15 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6275 v39 = (double)v17 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6276 v18 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6277 v19 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6278 v39 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6279 v20 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6280 v21 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6281 v37 = LODWORD(v20) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6282 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v21) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6283 v22 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6284 v23 = LODWORD(v22) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6285 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6286 v24 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6287 v33 = (LODWORD(v24) + (*(int *)(v4 - 3) & 0xFF)) | ((v23 | ((v37 | ((LODWORD(v18) + v19) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6288 v25 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6289 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6290 v26 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6291 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6292 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6293 v26 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6294 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6295 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6296 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6297 *v25 = *(int *)v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6298 v25[1] = *(int *)(v26 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6299 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6301 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6302 v27 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6303 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6304 *v40 = *(int *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6305 v28 = (int)(v5 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6306 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6307 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6308 v28 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6309 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6310 v40 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6311 *v27 = *(int *)v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6312 v27[1] = *(int *)(v28 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6313 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6314 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6315 --v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6316 if ( !v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6317 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6319 v6 = (a2 - *(float *)v5) / (*(float *)(v4 + 1) - *(float *)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6320 v7 = (unsigned __int8)v4[16] - (unsigned int)(unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6321 v36 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6322 v31 = (*(float *)(v4 + 5) - *(float *)(v4 - 11)) * v6 + *(float *)(v4 - 11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6323 v32 = (*(float *)(v4 + 9) - *(float *)(v4 - 7)) * v6 + *(float *)(v4 - 7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6324 *(float *)&v37 = (double)v7 * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6325 v8 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6326 v9 = (unsigned __int8)*v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6327 *(float *)&v37 = (double)((unsigned __int8)v4[15] - (unsigned int)(unsigned __int8)*(v4 - 1)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6328 v10 = *(float *)&v37 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6329 v11 = (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6330 v37 = LODWORD(v10) + (unsigned __int8)*(v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6331 v39 = (double)((unsigned int)(unsigned __int8)v4[14] - v11) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6332 v12 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6333 v13 = LODWORD(v12) + (unsigned __int8)*(v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6334 v39 = (double)((*(int *)(v4 + 13) & 0xFF) - (*(int *)(v4 - 3) & 0xFFu)) * v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6335 v14 = v39 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6336 v33 = (LODWORD(v14) + (*(int *)(v4 - 3) & 0xFF)) | ((v13 | ((v37 | ((LODWORD(v8) + v9) << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6337 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6338 //this = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6339 v5 = (char *)&v30 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6340 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6342 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6343 result = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6344 this->field_10 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6345 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6346 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6347
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6348 //----- (00477C61) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6349 int stru6_stru1_indoor_sw_billboard::sub_477C61()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6351 stru6_stru1_indoor_sw_billboard *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6352 int v2; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6353 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6354 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6355 double v5; // st7@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6356 double v6; // st6@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6357 double v7; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6358 float v8; // ST30_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6359 float v9; // ST24_4@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6360 double v10; // st7@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6361 double v11; // st6@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6362 double v12; // st5@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6363 float v13; // ST24_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6364 int v14; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6365 char *v15; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6366 signed int v16; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6367 __int16 v17; // fps@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6368 unsigned __int8 v18; // c2@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6369 unsigned __int8 v19; // c3@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6370 double v20; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6371 float v21; // ST18_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6372 float v22; // ST2C_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6373 float v23; // ST34_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6374 float v24; // ST24_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6375 double v25; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6376 double v26; // st6@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6377 float v27; // ST34_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6378 float v28; // ST30_4@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6379 int v29; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6380 signed int v31; // [sp+8h] [bp-28h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6381 float v32; // [sp+Ch] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6382 float v33; // [sp+14h] [bp-1Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6383 float v34; // [sp+18h] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6384 float v35; // [sp+1Ch] [bp-14h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6385 float v36; // [sp+20h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6386 float v37; // [sp+24h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6387 float v38; // [sp+24h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6388 float v39; // [sp+28h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6389 float v40; // [sp+28h] [bp-8h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6390 float v41; // [sp+2Ch] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6391 float v42; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6392
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6393 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6394 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6395 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6396 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6397 if ( v1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6399 v3 = (int)&v1->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6400 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6402 v4 = *(float *)(v3 - 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6403 LODWORD(v37) = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6404 LODWORD(v36) = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6405 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6407 v5 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6408 v6 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6409 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6411 v41 = pBLVRenderParams->fSineY * v6 + pBLVRenderParams->fCosineY * v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6412 v7 = pBLVRenderParams->fSineY * v5 - pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6414 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6416 v41 = pBLVRenderParams->fCosineY * v5 - pBLVRenderParams->fSineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6417 v7 = pBLVRenderParams->fSineY * v5 + pBLVRenderParams->fCosineY * v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6419 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6420 v9 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6421 v10 = pBLVRenderParams->fCosineNegX * v41 - pBLVRenderParams->fSineNegX * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6422 v11 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6423 v12 = pBLVRenderParams->fCosineNegX * v9 + pBLVRenderParams->fSineNegX * v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6425 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6426 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6427 v42 = v4 - (double)pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6428 v39 = v37 - (double)pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6429 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6431 v10 = pBLVRenderParams->fSineY * v39 + pBLVRenderParams->fCosineY * v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6432 v11 = pBLVRenderParams->fSineY * v42 - pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6433 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6434 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6436 v10 = pBLVRenderParams->fCosineY * v42 - pBLVRenderParams->fSineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6437 v11 = pBLVRenderParams->fSineY * v42 + pBLVRenderParams->fCosineY * v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6439 v12 = v36 - (double)pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6441 v13 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6442 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6443 *(int *)(v3 + 84) = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6444 v14 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6445 *(float *)(v3 + 76) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6446 *(int *)(v3 + 88) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6447 *(float *)(v3 + 80) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6448 v3 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6449 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6450 while ( v2 < v1->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6453 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6455 v15 = (char *)&this->field_14[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6456 v31 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6457 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6458 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6459 v40 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6460 v32 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6461 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6462 v34 = (double)stru_5C6E00->SinCos(pIndoorCamera->sRotationY) * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6463 v16 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6464 LODWORD(v38) = *(int *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6465 v33 = (double)v16 * 0.0000152587890625;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6466 //UNDEF(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6467 v20 = *((float *)v15 - 1) - (double)pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6468 if ( v19 | v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6470 v27 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6471 LODWORD(v35) = *((int *)v15 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6472 v28 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6473 v25 = v33 * v28 + v34 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6474 v26 = v34 * v28 - v33 * v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6476 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6478 v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6479 v22 = v38 - (double)pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6480 v23 = v33 * v22 + v34 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6481 v24 = *((float *)v15 + 1) - (double)pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6482 v25 = v32 * v24 + v40 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6483 v26 = v34 * v22 - v33 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6484 v35 = v40 * v24 - v32 * v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6485 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6486 *((int *)v15 + 21) = LODWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6487 v29 = *((int *)v15 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6488 *((float *)v15 + 19) = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6489 *((int *)v15 + 22) = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6490 *((float *)v15 + 20) = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6491 v15 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6492 --v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6494 while ( v31 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6496 v1->field_10 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6497 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6499
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6500 //----- (00477F63) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6501 bool stru6_stru1_indoor_sw_billboard::sub_477F63()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6503 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6504 stru6_stru1_indoor_sw_billboard *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6505 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6506 int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6507 char *v5; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6508 int v6; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6509 float v7; // ST08_4@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6510 signed int v9; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6511 float v10; // [sp+10h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6512
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6513 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6514
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6515 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6516 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6517 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6518 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6519 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6520 v10 = 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6521 v3 = (double)pBLVRenderParams->field_40 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6523 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6525 v10 = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6526 v3 = 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6528 v4 = a1->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6529 if ( v4 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6530 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6531 v5 = (char *)&a1->field_14[20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6532 v6 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6533 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6535 if ( v3 >= *(float *)v5 || *(float *)v5 >= (double)v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6537 if ( v3 < *(float *)v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6538 v9 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6539 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6540 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6542 v5 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6543 --v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6545 while ( v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6546 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6548 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6550 v2->_477927(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6551 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6552 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6553 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6554 memcpy(&v2->field_14[40], &v2->field_14[20], 16 * v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6555 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6556 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6557 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6558 _4775ED(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6559 return v2->field_10 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6560 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6561
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6562 //----- (0047802A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6563 int stru6_stru1_indoor_sw_billboard::sub_47802A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6564 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6565 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6566 stru6_stru1_indoor_sw_billboard *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6567 int v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6568 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6569 float v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6570 double v6; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6571 double v7; // ST30_8@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6572 double v8; // st6@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6573 double v9; // st5@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6574 char *v10; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6575 float v11; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6576 double v12; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6577 double v13; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6578 double v14; // st5@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6579 signed int v16; // [sp+38h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6580 int a6; // [sp+3Ch] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6581 int a5; // [sp+40h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6582
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6583 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6585 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6586 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6587 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6588 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6589 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6590 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6591 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6593 v4 = (char *)&a1->field_14[42];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6594 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6595 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6596 LODWORD(v5) = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6597 v6 = (double)pBLVRenderParams->field_40 * 0.000015258789 / *((float *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6598 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6599 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6600 v7 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6601 pGame->pIndoorCameraD3D->Project(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6602 COERCE_UNSIGNED_INT64(v5 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6603 COERCE_UNSIGNED_INT64(*((float *)v4 - 1) + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6604 COERCE_UNSIGNED_INT64(*(float *)v4 + 6.7553994e15),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6605 &a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6606 &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6607 *((float *)v4 + 18) = (double)a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6608 *((float *)v4 + 19) = (double)a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6609 *((float *)v4 + 20) = (double)SLODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6610 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6611 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6612 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6613 *((float *)v4 + 18) = (double)pBLVRenderParams->uViewportCenterX - v6 * *((float *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6614 v8 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6615 v9 = v6 * *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6616 *((int *)v4 + 20) = LODWORD(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6617 *((float *)v4 + 19) = v8 - v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6618 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6619 *((int *)v4 + 21) = *((int *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6620 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6621 && (double)(signed int)pViewport->uViewportZ > *((float *)v4 + 18)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6622 && (double)(signed int)pViewport->uViewportY <= *((float *)v4 + 19)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6623 && (double)(signed int)pViewport->uViewportW > *((float *)v4 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6624 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6625 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6626 v4 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6628 while ( v3 < v2->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6629 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6630 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6631 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6633 if ( a1->field_10 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6635 v10 = (char *)&a1->field_14[40];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6636 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6637 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6638 LODWORD(v11) = *(int *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6639 v12 = (double)pOutdoorCamera->int_fov_rad / *(float *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6640 *((float *)v10 + 20) = (double)pViewport->uScreenCenterX - v12 * *((float *)v10 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6641 v13 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6642 v14 = v12 * *((float *)v10 + 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6643 *((int *)v10 + 22) = LODWORD(v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6644 *((int *)v10 + 23) = *((int *)v10 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6645 *((float *)v10 + 21) = v13 - v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6646 if ( (double)(signed int)pViewport->uViewportX <= *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6647 && (double)(signed int)pViewport->uViewportZ > *((float *)v10 + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6648 && (double)(signed int)pViewport->uViewportY <= *((float *)v10 + 21)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6649 && (double)(signed int)pViewport->uViewportW > *((float *)v10 + 21) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6650 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6651 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6652 v10 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6654 while ( v1 < v2->field_10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6657 return v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6659
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6660
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6661
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6662 //----- (004783FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6663 void __cdecl sub_4783FA_construct_global_73D150()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6664 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6665 char *v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6666 signed int v1; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6667
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6668 v0 = (char *)&array_73D150[0].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6669 v1 = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6670 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6672 *(float *)v0 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6673 v0 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6674 --v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6676 while ( v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6678
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6679
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6680
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6681 //----- (0047840D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6682 char Render::DrawBuildingsD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6684 IndoorCameraD3D *v0; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6685 char result; // al@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6686 Vec3_int_ **v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6687 Vec3_int_ *v3; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6688 ODMFace *pFace; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6689 int v5; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6690 int v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6691 stru148 *v7; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6692 LightmapBuilder *v8; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6693 int v9; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6694 char v10; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6695 Texture *pFaceTexture; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6696 signed int v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6697 unsigned int v13; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6698 unsigned int v14; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6699 unsigned int v15; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6700 unsigned int v16; // edi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6701 int v17; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6702 int v18; // edi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6703 char *v19; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6704 char *v20; // ecx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6705 Vec3_int_ *v21; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6706 int v22; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6707 char *v23; // edi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6708 int v24; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6709 int v25; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6710 int v26; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6711 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6712 int v28; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6713 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6714 double v30; // st7@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6715 LightmapBuilder *v31; // edi@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6716 signed int v32; // eax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6717 int v33; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6718 unsigned int v34; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6719 std::string v35; // [sp-18h] [bp-70h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6720 int v36; // [sp-14h] [bp-6Ch]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6721 RenderVertexSoft *v37; // [sp-10h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6722 int v38; // [sp-Ch] [bp-64h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6723 LightmapBuilder *v39; // [sp-8h] [bp-60h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6724 int v40; // [sp-4h] [bp-5Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6725 std::string *v41; // [sp+Ch] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6726 Vec3_int_ *v42; // [sp+10h] [bp-48h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6727 LightmapBuilder *pLightmapBuilder; // [sp+14h] [bp-44h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6728 float v44; // [sp+18h] [bp-40h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6729 float v45; // [sp+1Ch] [bp-3Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6730 ODMFace *v46; // [sp+20h] [bp-38h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6731 IndoorCameraD3D *v47; // [sp+24h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6732 unsigned int v48; // [sp+28h] [bp-30h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6733 int v49; // [sp+2Ch] [bp-2Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6734 int v50; // [sp+30h] [bp-28h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6735 int v51; // [sp+34h] [bp-24h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6736 int v52; // [sp+38h] [bp-20h]@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6737 int v53; // [sp+3Ch] [bp-1Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6738 Vec3_int_ *v54; // [sp+40h] [bp-18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6739 int a1; // [sp+44h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6740 Vec3_int_ **v56; // [sp+48h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6741 int uNumVertices; // [sp+4Ch] [bp-Ch]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6742 int unused; // [sp+50h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6743 int a3; // [sp+57h] [bp-1h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6744
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6745 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6747 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
6748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6749 unused = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6750 v0 = pGame->pIndoorCameraD3D;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6751 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6752 v47 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6753 result = LOBYTE(pOutdoor->pBModels);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6754 v41 = (std::string *)pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6755 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6756 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6757 v2 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6758 v56 = (Vec3_int_ **)&pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6759 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6761 if ( IsBModelVisible(a1, &unused) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6762 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6763 *(v2 - 3) = (Vec3_int_ *)((unsigned int)*(v2 - 3) | 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6764 v3 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6765 pFace = (ODMFace *)v2[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6766 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6767 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6768 v42 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6769 if ( (signed int)v3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6770 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6771 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6772 LABEL_86:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6773 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6774 v2 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6775 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6776 v56 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6777 if ( a1 >= (signed int)v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6778 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6779 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6780 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6781 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6782 if (pFace->Invisible())
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6783 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6784 v5 = (int)*(v2 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6785 v6 = pFace->pVertexIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6786 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6787 v7 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6788 v8 = *(LightmapBuilder **)(v5 + 12 * v6 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6789 *(int *)&v7->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6790 pLightmapBuilder = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6791 v9 = pFace->uTextureID;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6792 v10 = (BYTE1(pFace->uAttributes) & 0x40) == 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6793 v48 = pFace->uTextureID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6794 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6796 v48 = pTextureFrameTable->GetFrameTexture(v9, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6797 v9 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6799 pFaceTexture = (Texture *)(v9 != -1 ? (int)&pBitmaps_LOD->pTextures[v9] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6800 v7->pTexture = pFaceTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6801 v12 = (v9 != -1 ? pBitmaps_LOD->pTextures[v9].uTextureWidth : 24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6802 v49 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6803 v49 = pFaceTexture->uTextureHeight;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6804 v10 = (pFace->uAttributes & 0x10) == 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6805 v45 = 1.0 / (double)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6806 v44 = 1.0 / (double)v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6807 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6808 *(int *)&v7->flags |= 2u;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6809 if ( BYTE2(pFace->uAttributes) & 0x40 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6810 HIBYTE(v7->flags) |= 4u;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6811 v13 = pFace->uAttributes;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6812 if ( v13 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6813 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6814 HIBYTE(v7->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6816 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6818 if ( v13 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6819 HIBYTE(v7->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6820 }
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6821 v14 = pFace->uAttributes;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6822 if ( BYTE1(v14) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6824 *(int *)&v7->flags |= 0x2000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6826 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6827 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6828 if ( v14 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6829 HIBYTE(v7->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6831 v15 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6832 v7->sTextureDeltaU = pFace->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6833 v7->sTextureDeltaV = pFace->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6834 v16 = v15 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6835 if ( pFace->pFacePlane.vNormal.z && (v40 = pFace->pFacePlane.vNormal.z, abs(v40) >= 59082) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6837 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6838 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6839 goto LABEL_29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6840 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6842 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6843 v7->sTextureDeltaV -= v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6844 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6847 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6849 v17 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6850 if ( BYTE1(v17) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6851 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6852 if ( BYTE1(v17) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6854 LABEL_29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6855 v7->sTextureDeltaV += v16 & v7->pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6856 goto LABEL_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6859 LABEL_30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6860 if ( BYTE1(v17) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6862 v7->sTextureDeltaU -= v16 & v7->pTexture->uWidthMinus1;
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 if ( BYTE1(v17) & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6867 v7->sTextureDeltaU += v16 & v7->pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6869 v18 = pFace->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6870 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6871 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6872 uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6873 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6874 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6875 v19 = (char *)&array_73D150[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6876 v20 = (char *)pFace->pTextureUIDs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6877 v51 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6878 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6880 v21 = &(*(v56 - 1))[*((short *)v20 - 20)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6881 *((float *)v19 - 2) = (double)v21->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6882 *((float *)v19 - 1) = (double)v21->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6883 *(float *)v19 = (double)v21->z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6884 v19 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6885 v52 = v7->sTextureDeltaU + *(short *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6886 *((float *)v19 - 5) = (double)v52 * v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6887 v22 = v7->sTextureDeltaV + *((short *)v20 + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6888 v20 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6889 v10 = v51-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6890 v52 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6891 *((float *)v19 - 4) = (double)v22 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6892 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6893 while ( !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6894 v23 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6895 v51 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6896 *(float *)&pLightmapBuilder = (double)(signed int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6897 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6899 if ( *(float *)&pLightmapBuilder == *((float *)v23 - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6900 ++v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6901 v47->ViewTransform((RenderVertexSoft *)(v23 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6902 if ( *(float *)v23 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6903 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6904 if ( *(float *)v23 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6905 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6906 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6907 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6909 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6910 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6911 v47->Project((RenderVertexSoft *)(v23 - 12), 1u, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6913 v23 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6914 --v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6915 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6916 while ( v51 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6917 v18 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6919 if ( v53 == v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6920 LOBYTE(v7->field_32) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6921 v24 = pOutdoor->vSunlight.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6922 v7->pODMFace = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6923 v7->uNumVertices = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6924 v7->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6925 pLightmapBuilder = (LightmapBuilder *)-v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6926 v51 = pFace->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6927 v51 = (unsigned __int64)(-v24 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6928 v53 = pFace->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6929 pLightmapBuilder = (LightmapBuilder *)-pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6930 v53 = (unsigned __int64)(-pOutdoor->vSunlight.y * (signed __int64)v53) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6931 v52 = pFace->pFacePlane.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6932 v52 = (unsigned __int64)(-pOutdoor->vSunlight.z * (signed __int64)v52) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6933 pLightmapBuilder = (LightmapBuilder *)(v51 + v53 + v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6934 v51 = 20 * (int)pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6935 result = 20 - (20 * (signed int)pLightmapBuilder >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6936 v7->field_58 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6937 if ( result < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6938 v7->field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6939 if ( v7->field_58 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6940 v7->field_58 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6941 if ( pOutdoorCamera->numStru148s >= 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6942 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6943 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6944 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6945 if ( ODMFace::IsBackfaceCulled(pFace, array_73D150, v7) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6946 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6947 LOBYTE(v25) = (char)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6948 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6949 pFace->bVisible = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6950 v7->uBModelFaceID = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6951 LOWORD(v25) = (unsigned __int8)v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6952 v7->uBModelID = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6953 v27 = 8 * (v25 | (v26 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6954 LOBYTE(v27) = v27 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6955 v7->field_50 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6956 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6957 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6958 v28 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6959 v29 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6960 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6962 v30 = 1.0 / (array_73D150[v28].vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6963 memcpy(&array_50AC10[v28], &array_73D150[v28], sizeof(array_50AC10[v28]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6964 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6965 --v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6966 array_50A2B0[v28 + 49].flt_20 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6968 while ( v29 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6969 pFace = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6971
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6972 static stru154 static_RenderBuildingsD3D_stru_73C834;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6973 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6974 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6975 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6976 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6977
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6978 static_RenderBuildingsD3D_byte_73C84C_init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6979 stru154::stru154(&static_RenderBuildingsD3D_stru_73C834);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6980 atexit(loc_4789D4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6981 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6982
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6983 v40 = (int)pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6984 pLightmapBuilder = pGame->pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6985 v31 = pLightmapBuilder;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6986 pLightmapBuilder->ApplyLights_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6987 pDecalBuilder->ApplyDecals_OutdoorFace(pFace);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6988 v31->std__vector_000004_size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6989 LOBYTE(v31) = 0;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
6990 if ( stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6992 v31 = (LightmapBuilder *)(v50 ? 3 : v49 != 0 ? 5 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6993 static_RenderBuildingsD3D_stru_73C834._49B04D(pFace, (BSPVertexBuffer *)v56 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6994 if ( pDecalBuilder->uNumDecals > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6996 v40 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6997 v39 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6998 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6999 v37 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7000 v36 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7001 pDecalBuilder->ApplyDecals(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7002 31 - v7->field_58,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7003 2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7004 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7005 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7006 array_50AC10,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7007 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7008 (char)v31,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7009 -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7010 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7011 }
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7012 if ( stru_F8AD28.uNumLightsApplied > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7013 pLightmapBuilder->ApplyLights(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7014 &stru_F8AD28,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7015 &static_RenderBuildingsD3D_stru_73C834,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7016 uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7017 array_50AC10,
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
7018 0,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7019 (char)v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7020 if ( v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7021 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7022 v32 = sr_424CD7(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7023 goto LABEL_76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7025 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7027 v32 = sr_424EE0_MakeFanFromTriangle(uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7028 LABEL_76:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7029 v7->uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7030 uNumVertices = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7031 OutdoorCamera::Project(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7032 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7033 if ( uNumVertices )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7034 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7035 v33 = *(int *)&v7->flags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7036 if ( v33 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7038 if ( BYTE1(v33) & 0x3C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7039 v34 = pRenderer->pHDWaterBitmapIDs[0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7040 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7041 v34 = pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7042 v40 = (int)pBitmaps_LOD->pHardwareTextures[v34];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7043 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7044 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7046 v40 = (int)pBitmaps_LOD->pHardwareTextures[v48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7048 pRenderer->DrawPolygon(uNumVertices, v7, pFace, (IDirect3DTexture2 *)v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7050 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7052 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7053 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7054 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7055 v54 = (Vec3_int_ *)((char *)v54 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7056 v2 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7057 ++pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7058 v46 = pFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7059 if ( (signed int)v54 >= (signed int)v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7060 goto LABEL_86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7062 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7063 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7065 // 73C84C: using guessed type char static_RenderBuildingsD3D_byte_73C84C_init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7066
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7067 //----- (004789DE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7068 BSPModel *Render::DrawBuildingsSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7069 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7070 BSPModel *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7071 unsigned int *v1; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7072 int v2; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7073 int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7074 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7075 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7076 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7077 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7078 double v8; // st7@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7079 char *v9; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7080 int v10; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7081 double v11; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7082 stru148 *v12; // ebx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7083 double v13; // st7@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7084 double v14; // ST4C_8@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7085 int v15; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7086 int v16; // eax@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7087 int v17; // ecx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7088 unsigned __int8 v18; // sf@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7089 unsigned __int8 v19; // of@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7090 int v20; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7091 int v21; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7092 int v22; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7093 int v23; // eax@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7094 int v24; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7095 Texture *v25; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7096 int v26; // esi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7097 signed int v27; // ecx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7098 double v28; // st6@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7099 double v29; // st5@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7100 int v30; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7101 int v31; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7102 double v32; // st4@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7103 int v33; // ecx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7104 char v34; // zf@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7105 BSPVertexBuffer *v35; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7106 unsigned int v36; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7107 signed int v37; // esi@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7108 int v38; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7109 signed int v39; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7110 char *v40; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7111 double v41; // ST1C_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7112 double v42; // ST24_8@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7113 signed int v43; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7114 signed int v44; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7115 int v45; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7116 signed int v46; // edx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7117 char *v47; // ecx@63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7118 double v48; // ST34_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7119 double v49; // ST44_8@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7120 int v50; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7121 signed int v51; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7122 char *v52; // edx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7123 double v53; // ST3C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7124 double v54; // ST2C_8@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7125 float v55; // [sp+44h] [bp-7Ch]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7126 float v56; // [sp+48h] [bp-78h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7127 float v57; // [sp+4Ch] [bp-74h]@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7128 float v58; // [sp+50h] [bp-70h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7129 int v59; // [sp+54h] [bp-6Ch]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7130 int v60; // [sp+58h] [bp-68h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7131 float v61; // [sp+5Ch] [bp-64h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7132 float v62; // [sp+60h] [bp-60h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7133 float v63; // [sp+64h] [bp-5Ch]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7134 float v64; // [sp+68h] [bp-58h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7135 int v65; // [sp+6Ch] [bp-54h]@64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7136 int v66; // [sp+70h] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7137 int v67; // [sp+74h] [bp-4Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7138 int v68; // [sp+78h] [bp-48h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7139 int v69; // [sp+7Ch] [bp-44h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7140 int v70; // [sp+80h] [bp-40h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7141 int v71; // [sp+84h] [bp-3Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7142 float v72; // [sp+88h] [bp-38h]@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7143 int v73; // [sp+8Ch] [bp-34h]@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7144 int v74; // [sp+90h] [bp-30h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7145 int v75; // [sp+94h] [bp-2Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7146 int v76; // [sp+98h] [bp-28h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7147 int v77; // [sp+9Ch] [bp-24h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7148 unsigned int *v78; // [sp+A0h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7149 int v79; // [sp+A4h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7150 int a1; // [sp+A8h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7151 int v81; // [sp+ACh] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7152 int v82; // [sp+B0h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7153 int v83; // [sp+B4h] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7154 signed int v84; // [sp+B8h] [bp-8h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7155 int a2; // [sp+BCh] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7156
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7157 a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7158 a1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7159 result = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7160 v66 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7161 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7163 v1 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7164 v78 = &pOutdoor->pBModels->uNumFaces;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7165 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7167 if ( IsBModelVisible(a1, &a2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7169 *(v1 - 3) |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7170 v2 = *v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7171 v3 = v1[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7172 v79 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7173 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7174 v68 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7175 if ( v2 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7176 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7178 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7179 ++a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7180 v1 += 47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7181 result = (BSPModel *)a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7182 v78 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7183 if ( a1 >= v66 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7184 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7186 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7188 if ( !(*(char *)(v3 + 29) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7190 v4 = 3 * *(short *)(v3 + 32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7191 v5 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7192 v67 = (int)(v1 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7193 v6 = *(int *)(*(v1 - 1) + 4 * v4 + 8) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7194 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7195 v83 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7196 v74 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7197 v7 = *(char *)(v3 + 302);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7198 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7199 v77 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7200 if ( v7 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7202 v8 = (double)v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7203 v9 = (char *)&array_73D150[0].vWorldViewPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7204 v81 = v3 + 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7205 v83 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7206 *(float *)&v84 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7207 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7209 v10 = *(int *)(v5 + 4) + 12 * *(short *)v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7210 *((float *)v9 - 3) = (double)*(signed int *)v10 + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7211 *((float *)v9 - 2) = (double)*(signed int *)(v10 + 4) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7212 v11 = (double)*(signed int *)(v10 + 8) + 4.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7213 *((float *)v9 - 1) = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7214 if ( *(float *)&v84 == v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7215 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7216 pGame->pIndoorCameraD3D->ViewTransform((RenderVertexSoft *)(v9 - 12), 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7217 if ( *(float *)v9 < 8.0 || (double)pOutdoorCamera->shading_dist_mist < *(float *)v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7219 if ( *(float *)v9 >= 8.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7220 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7221 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7222 v74 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7224 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7225 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7226 pGame->pIndoorCameraD3D->Project((RenderVertexSoft *)(v9 - 12), 1u, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7228 v81 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7229 v9 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7230 --v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7231 if ( !v83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7232 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7233 v5 = v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7234 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7235 v7 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7237 v12 = &array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7238 *(int *)&v12->flags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7239 if ( v82 == v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7240 *(int *)&v12->flags = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7241 v12->pODMFace = (ODMFace *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7242 v12->uNumVertices = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7243 v12->field_59 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7244 v84 = *(int *)v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7245 v83 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7246 v82 = -pOutdoor->vSunlight.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7247 v84 = *(int *)(v3 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7248 v82 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7249 v81 = -pOutdoor->vSunlight.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7250 v84 = *(int *)(v3 + 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7251 v81 = (unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7252 v84 = v83 + v82 + ((unsigned __int64)(v84 * (signed __int64)-pOutdoor->vSunlight.z) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7253 v13 = (double)v84 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7254 if ( v13 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7255 v13 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7256 *(float *)&v84 = v13 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7257 v14 = *(float *)&v84 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7258 v71 = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7259 v15 = (int)&v12->field_58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7260 v12->field_58 = 31 - LOBYTE(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7261 if ( (char)(31 - LOBYTE(v14)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7262 *(char *)v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7263 if ( *(char *)v15 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7264 *(char *)v15 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7265 v16 = *(short *)(v3 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7266 if ( *(char *)(v3 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7267 v16 = pTextureFrameTable->GetFrameTexture(v16, pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7268 v17 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7269 result = (BSPModel *)&pBitmaps_LOD->pTextures[v16];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7270 v19 = __OFSUB__(pOutdoorCamera->numStru148s, 1999);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7271 v18 = pOutdoorCamera->numStru148s - 1999 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7272 v12->pTexture = (Texture *)(v17 != -1 ? (int)result : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7273 if ( !(v18 ^ v19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7274 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7275 ++pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7276 ++pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7277 if ( !ODMFace::IsBackfaceCulled((ODMFace *)v3, array_73D150, v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7279 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7280 --pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7281 --pOutdoorCamera->field_44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7282 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7284 LOBYTE(v20) = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7285 v21 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7286 *(char *)(v3 + 305) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7287 v12->uBModelFaceID = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7288 LOWORD(v20) = (unsigned __int8)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7289 v12->uBModelID = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7290 v22 = 8 * (v20 | (v21 << 6));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7291 LOBYTE(v22) = v22 | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7292 v12->field_50 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7293 if ( *(char *)(v3 + 28) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7294 *(int *)&v12->flags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7295 if ( *(char *)(v3 + 30) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7296 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7297 v23 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7298 if ( v23 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7300 HIBYTE(v12->flags) |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7302 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7304 if ( v23 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7305 HIBYTE(v12->flags) |= 8u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7307 v24 = *(int *)(v3 + 28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7308 if ( BYTE1(v24) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7309 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7310 HIBYTE(v12->flags) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7312 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7314 if ( v24 & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7315 HIBYTE(v12->flags) |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7317 v25 = v12->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7318 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7319 v27 = v25->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7320 v84 = v25->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7321 v28 = 1.0 / (double)v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7322 v29 = 1.0 / (double)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7323 if ( v77 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7325 v30 = v3 + 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7326 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7327 v83 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7328 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7330 v32 = 1.0 / (*(float *)(v31 * 48 + 7590236) + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7331 memcpy(&array_50AC10[v31], &array_73D150[v31], sizeof(array_50AC10[v31]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7332 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7333 array_50A2B0[v31 + 49].flt_20 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7334 v84 = v12->sTextureDeltaU + *(short *)(v30 - 40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7335 array_50A2B0[v31 + 49].u = (double)v84 * v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7336 v33 = v12->sTextureDeltaV + *(short *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7337 v30 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7338 v34 = v83-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7339 v84 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7340 array_50A2B0[v31 + 49].v = (double)v33 * v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7342 while ( !v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7343 v3 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7344 v26 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7345 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7346
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7347 static stru154 static_sub_004789DE_stru_73C818; // idb
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7348 /*static bool __init_flag = false;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7349 if (!__init_flag)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7351 __init_flag = true;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7352
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7353 static_sub_004789DE_byte_73C830__init_flag |= 1u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7354 stru154::stru154(&static_sub_004789DE_stru_73C818);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7355 }*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7356
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7357 pGame->pLightmapBuilder->ApplyLights_OutdoorFace((ODMFace *)v3);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7358 if ( stru_F8AD28.uNumLightsApplied <= 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7360 v12->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7362 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7364 v35 = (BSPVertexBuffer *)(v78 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7365 v12->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7367 static_sub_004789DE_stru_73C818._49B04D((ODMFace *)v3, v35);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7368 v55 = static_sub_004789DE_stru_73C818.face_plane.vNormal.x;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7369 v56 = static_sub_004789DE_stru_73C818.face_plane.vNormal.y;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
7370 v57 = static_sub_004789DE_stru_73C818.face_plane.vNormal.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7371 pGame->pLightmapBuilder->_45CA88(&stru_F8AD28, array_50AC10, v26, (Vec3_float_ *)&v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7373 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7375 v36 = sr_4250FE(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7376 v37 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7377 if ( !v36 || (OutdoorCamera::Project(v36), v38 = sr_4254D2(v37), (v12->uNumVertices = v38) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7378 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7379 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7380 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7381 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7382 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7383 v40 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7384 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7386 LODWORD(v64) = *((int *)v40 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7387 v41 = v64 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7388 v69 = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7389 dword_50B638[v39] = LODWORD(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7390 LODWORD(v63) = *(int *)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7391 v42 = v63 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7392 v73 = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7393 v40 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7394 dword_50B570[v39++] = LODWORD(v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7395 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7396 while ( v39 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7399 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7401 if ( v75 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7403 v43 = sr_4252E8(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7404 v44 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7405 if ( !v43 || (OutdoorCamera::Project(v43), v45 = sr_4254D2(v44), (v12->uNumVertices = v45) == 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7406 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7407 v12->_48276F_sr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7408 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7409 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7411 v47 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7412 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7414 LODWORD(v61) = *((int *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7415 v48 = v61 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7416 v65 = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7417 dword_50B638[v46] = LODWORD(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7418 LODWORD(v58) = *(int *)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7419 v49 = v58 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7420 v59 = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7421 v47 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7422 dword_50B570[v46++] = LODWORD(v49);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7424 while ( v46 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7427 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7429 v50 = sr_4254D2(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7430 v12->uNumVertices = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7431 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7432 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7433 sr_sub_4829B9(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7434 &array_73D150[*(char *)(v3 + 298)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7435 &array_73D150[*(char *)(v3 + 299)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7436 &array_73D150[*(char *)(v3 + 300)],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7437 v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7438 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7439 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7440 if ( (signed int)v12->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7442 v52 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7443 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7445 LODWORD(v62) = *((int *)v52 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7446 v53 = v62 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7447 v60 = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7448 dword_50B638[v51] = LODWORD(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7449 LODWORD(v72) = *(int *)v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7450 v54 = v72 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7451 v70 = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7452 v52 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7453 dword_50B570[v51++] = LODWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7455 while ( v51 < (signed int)v12->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7459 sr_sub_486B4E_push_outdoor_edges(array_508690, dword_50B638, dword_50B570, v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7461 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7462 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7463 v1 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7464 v3 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7465 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7466 if ( v79 >= v68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7467 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7470 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7472 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7473 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7474 // 73C830: using guessed type char static_sub_004789DE_byte_73C830__init_flag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7475
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7476 //----- (00479089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7477 bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7479 BSPModel *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7480 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7481 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7482 int v5; // ST28_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7483 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7484 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7485 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7486 int v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7487 int v10; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7488 signed int v11; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7489 int v12; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7490 bool result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7491 unsigned int v14; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7492 int v15; // [sp+Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7493 int *v16; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7494 int v17; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7495 int v18; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7496 int v19; // [sp+20h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7497 int angle; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7498 int v21; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7499 int v22; // [sp+28h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7501 v16 = unused;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7502 angle = (signed int)(pOutdoorCamera->uCameraFovInDegrees << 11) / 360 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7503 v14 = uModelID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7504 v2 = &pOutdoor->pBModels[uModelID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7505 v3 = v2->vBoundingCenter.x - pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7506 v4 = v2->vBoundingCenter.y - pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7507 v5 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7508 v21 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7509 v18 = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7510 stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7511 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7512 v17 = v3 * v5 + v4 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7513 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7514 v17 = (unsigned __int64)(v17 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7515 v19 = v4 * v6 - v3 * v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7516 v7 = abs(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7517 v8 = abs(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7518 v9 = sub_4621DA(v8, v7, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7519 v10 = v14 * 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7520 v22 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7521 *v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7522 if ( v9 < pOutdoor->pBModels[v14].sBoundingRadius + 256 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7523 *v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7524 v15 = stru_5C6E00->SinCos(angle - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7525 if ( v19 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7526 v11 = ((unsigned __int64)(v15 * (signed __int64)v17) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7527 - ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7528 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7529 v11 = ((unsigned __int64)(stru_5C6E00->SinCos(angle) * (signed __int64)v19) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7530 + ((unsigned __int64)(v15 * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7531 v12 = v11 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7532 if ( v22 <= pOutdoorCamera->shading_dist_mist + 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7534 if ( abs(v12) > *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v10) + 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7536 result = v12 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7537 LOBYTE(result) = v12 >= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7539 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7541 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7542 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7544 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7546 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7548 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7550
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7551
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7552
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7553
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7554 //----- (00479295) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7555 int stru148::_479295()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7557 stru148 *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7558 ODMFace *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7559 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7560 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7561 int v5; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7562 int v6; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7563 int v7; // ST04_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7564 stru149 *v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7565 Vec3_int_ thisa; // [sp+Ch] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7566 int v11; // [sp+18h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7567
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7568 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7569 v2 = this->pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7570 if ( !v2->pFacePlane.vNormal.z )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7572 v3 = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7573 v4 = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7574 LABEL_9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7575 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7576 v11 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7577 goto LABEL_5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7579 if ( (v2->pFacePlane.vNormal.x || v2->pFacePlane.vNormal.y) && abs(v2->pFacePlane.vNormal.z) < 59082 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7581 thisa.x = -v2->pFacePlane.vNormal.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7582 thisa.y = v2->pFacePlane.vNormal.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7583 thisa.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7584 thisa.Normalize_float();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7585 v4 = thisa.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7586 v3 = thisa.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7587 goto LABEL_9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7588 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7589 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7590 v4 = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7591 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7592 v5 = -65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7593 LABEL_5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7594 v6 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7595 v1->sTextureDeltaU = v2->sTextureDeltaU;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7596 v7 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7597 v8 = v1->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7598 v1->sTextureDeltaV = v2->sTextureDeltaV;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7599 v8->_48616B(v4, v7, 0, 0, v5, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7600 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7602
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7603 //----- (00479332) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7604 int Render::OnOutdoorRedrawSW()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7606 signed int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7607 unsigned int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7608 char *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7609 char v3; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7610 double v4; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7611 float v5; // ST34_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7612 double v6; // ST24_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7613 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7614 unsigned int v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7615 signed int v9; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7616 Vec3_float_ *v10; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7617 double v11; // st7@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7618 float v12; // ST34_4@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7619 double v13; // ST1C_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7620 float v14; // [sp+4h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7621 float v15; // [sp+8h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7622 float v16; // [sp+Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7623
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7624 v14 = (double)pOutdoor->vSunlight.x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7625 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7626 v1 = (unsigned int)&array_77EC08[pOutdoorCamera->numStru148s];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7627 v15 = (double)pOutdoor->vSunlight.y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7628 v16 = (double)pOutdoor->vSunlight.z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7629 if ( v1 > (unsigned int)array_77EC08 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7631 v2 = (char *)&array_77EC08[0].pODMFace;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7632 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7633 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7634 v3 = v2[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7635 if ( v3 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7636 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7637 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7639 v9 = pTerrainNormalIndices[((*((int *)v2 - 9) >> 15) & 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7640 + 2 * ((unsigned __int8)v2[9] + ((unsigned __int8)v2[8] << 7))];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7641 if ( v9 > (signed int)(uNumTerrainNormals - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7642 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7643 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7644 v10 = &pTerrainNormals[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7645 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7647 v11 = -(v16 * v10->z + v15 * v10->y + v14 * v10->x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7648 if ( v11 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7649 v11 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7650 v12 = v11 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7651 v13 = v12 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7652 v2[4] = 31 - LOBYTE(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7654 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7656 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7658 if ( v2[4] < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7659 v2[4] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7660 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7662 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7663 v2 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7664 if ( (unsigned int)(v2 - 84) >= v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7665 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7667 v4 = (double)(signed int)(((unsigned __int64)(**(int **)v2 * (signed __int64)-pOutdoor->vSunlight.x) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7668 + ((unsigned __int64)(*(int *)(*(int *)v2 + 4) * (signed __int64)-pOutdoor->vSunlight.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7669 + ((unsigned __int64)(*(int *)(*(int *)v2 + 8) * (signed __int64)-pOutdoor->vSunlight.z) >> 16))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7670 * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7671 if ( v4 < 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7672 v4 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7673 v5 = v4 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7674 v6 = v5 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7675 v7 = (int)(v2 + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7676 v2[4] = 31 - LOBYTE(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7677 if ( (char)(31 - LOBYTE(v6)) < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7678 *(char *)v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7679 if ( *(char *)v7 > 31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7680 *(char *)v7 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7681 if ( *(char *)(*(int *)v2 + 29) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7682 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7683 v8 = pTextureFrameTable->GetFrameTexture(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7684 *((short *)v2 - 4),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7685 pEventTimer->uTotalGameTimeElapsed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7686 *((int *)v2 - 6) = v8 != -1 ? (int)&pBitmaps_LOD->pTextures[v8] : 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7688 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7689 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7690 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7692 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7694
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7695 //----- (00479543) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7696 void Render::DrawSkyD3D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7697 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7698 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7699 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7700 double v2; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7701 double v3; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7702 double v4; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7703 double v5; // st4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7704 double v6; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7705 char *v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7706 int v8; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7707 int v9; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7708 int v10; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7709 signed __int64 v11; // qax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7710 double v12; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7711 int v13; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7712 int v14; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7713 int v15; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7714 int v16; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7715 signed __int64 v17; // qtt@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7716 signed int v18; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7717 Texture *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7718 double v20; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7719 double v21; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7720 double v22; // st6@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7721 unsigned __int8 v23; // sf@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7722 unsigned __int8 v24; // of@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7723 stru148 _this; // [sp+14h] [bp-150h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7724 double v26; // [sp+120h] [bp-44h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7725 float v27; // [sp+128h] [bp-3Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7726 float v28; // [sp+12Ch] [bp-38h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7727 int v29; // [sp+130h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7728 int v30; // [sp+134h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7729 int v31; // [sp+138h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7730 int v32; // [sp+13Ch] [bp-28h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7731 int v33; // [sp+140h] [bp-24h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7732 float v34; // [sp+144h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7733 int v35; // [sp+148h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7734 double v36; // [sp+14Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7735 int v37; // [sp+154h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7736 int v38; // [sp+158h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7737 int v39; // [sp+15Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7738 int v40; // [sp+160h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7739
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7740 v30 = (signed __int64)((double)(pOutdoorCamera->int_fov_rad * pIndoorCamera->pos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7741 / ((double)pOutdoorCamera->int_fov_rad + 8192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7742 + (double)pViewport->uScreenCenterY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7743 v34 = cos((double)pIndoorCamera->sRotationX * 0.0030664064) * (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7744 v38 = (signed __int64)((double)pViewport->uScreenCenterY
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7745 - (double)pOutdoorCamera->int_fov_rad
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7746 / (v34 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7747 * (sin((double)pIndoorCamera->sRotationX * 0.0030664064)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7748 * (double)-pOutdoorCamera->shading_dist_mist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7749 - (double)pIndoorCamera->pos.z));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7750 _this._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7751 _this.ptr_38->_48694B();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7752 _this.uTileBitmapID = LOWORD(pOutdoor->uSky_TextureID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7753 _this.pTexture = (Texture *)(SLOWORD(pOutdoor->uSky_TextureID) != -1 ? (int)&pBitmaps_LOD->pTextures[SLOWORD(pOutdoor->uSky_TextureID)] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7754 if ( _this.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7756 v0 = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7757 _this.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7758 _this.uNumVertices = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7759 _this.v_18.x = -stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7760 _this.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7761 v1 = stru_5C6E00->SinCos(v0 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7762 v2 = (double)(signed int)pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7763 _this.v_18.z = -v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7764 array_50AC10[0].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7765 v3 = (double)(signed int)pViewport->uViewportY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7766 array_50AC10[0].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7767 array_50AC10[1].vWorldViewProjX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7768 v4 = (double)v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7769 _this.sTextureDeltaU = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7770 _this.sTextureDeltaV = 224 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7771 v28 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7772 array_50AC10[1].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7773 v5 = (double)(signed int)pViewport->uViewportZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7774 array_50AC10[2].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7775 v38 = pViewport->uViewportZ - pViewport->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7776 _this.field_24 = 0x2000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7777 array_50AC10[2].vWorldViewProjY = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7778 array_50AC10[3].vWorldViewProjX = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7779 array_50AC10[3].vWorldViewProjY = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7780 v36 = (double)(pViewport->uViewportZ - pViewport->uViewportX) * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7781 v6 = tan(0.6457717418670654);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7782 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7783 v33 = 65536 / (signed int)(signed __int64)(v36 / v6 + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7784 if ( (signed int)_this.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7785 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7786 v7 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7787 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7789 LODWORD(v27) = *(int *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7790 v26 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7791 v29 = LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7792 v38 = _this.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7793 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7794 v8 = v39 + _this.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7795 v39 = v33 * (v30 - LODWORD(v26));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7796 v35 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7797 v38 = _this.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7798 v39 = (unsigned __int64)(v38 * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7799 HIDWORD(v36) = v39 + _this.ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7800 v38 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7801 v9 = (unsigned __int64)(_this.v_18.z * (signed __int64)(v33 * (v30 - LODWORD(v26)))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7802 v10 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7803 v39 = _this.v_18.x + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7804 if ( _this.v_18.x + v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7805 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7806 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7807 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7809 v11 = (signed __int64)*((float *)v7 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7810 v38 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7811 v12 = *(float *)v7 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7812 v13 = v33 * (pViewport->uScreenCenterX - v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7813 LODWORD(v34) = -_this.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7814 v32 = (signed __int64)v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7815 v14 = v33 * (v30 - v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7816 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7817 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7818 v40 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7819 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7820 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7821 v37 = abs(SLODWORD(v34) >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7822 v15 = abs(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7823 if ( v37 <= v15 || v32 <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7825 if ( v39 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7826 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7827 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7828 v14 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7829 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7830 v37 = _this.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7831 v16 = (unsigned __int64)(_this.v_18.z * (signed __int64)v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7832 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7833 v14 += v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7834 v10 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7835 v39 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7836 v38 = _this.v_18.x + v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7837 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7838 LODWORD(v17) = LODWORD(v34) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7839 HIDWORD(v17) = SLODWORD(v34) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7840 v40 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7841 v18 = v17 / v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7842 if ( v18 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7843 v18 = pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7844 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7845 v37 = _this.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7846 v40 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7847 v37 = v35 + ((unsigned __int64)(v37 * (signed __int64)v13) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7848 v35 = _this.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7849 HIDWORD(v36) += (unsigned __int64)(v35 * (signed __int64)v13) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7850 v35 = 224 * pMiscTimer->uTotalGameTimeElapsed
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7851 + ((signed int)((unsigned __int64)(v37 * (signed __int64)v18) >> 16) >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7852 v40 = (unsigned __int64)(SHIDWORD(v36) * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7853 v19 = _this.pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7854 HIDWORD(v36) = _this.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7855 v7 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7856 v20 = (double)SHIDWORD(v36) * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7857 HIDWORD(v36) = 224 * pMiscTimer->uTotalGameTimeElapsed + (v40 >> 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7858 ++v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7859 *((float *)v7 - 10) = (double)v35 / v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7860 v21 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7861 HIDWORD(v36) = v19->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7862 v22 = (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7863 HIDWORD(v36) = v18 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7864 v24 = __OFSUB__(v31, _this.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7865 v23 = ((v31 - _this.uNumVertices) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7866 *((float *)v7 - 9) = v21 / (v22 * 65536.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7867 *((float *)v7 - 16) = (double)pOutdoorCamera->shading_dist_mist;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7868 *((float *)v7 - 11) = 1.0 / (double)SHIDWORD(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7869 if ( !(v23 ^ v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7871 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7872 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7873 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7874 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7875 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7876 array_50AC10[0].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7877 array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7878 array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7879 array_50AC10[3].vWorldViewProjY = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7880 pRenderer->DrawFan(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7881 _this.uNumVertices,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7882 &_this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7883 pBitmaps_LOD->pHardwareTextures[(signed __int16)_this.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7884 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7889
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7890
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7891 //----- (00479A53) --------------------------------------------------------
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
7892 void __fastcall _479A53_draw_some_blv_poly(unsigned int uNumVertices, unsigned int uFaceID)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7894 BLVFace *pFace; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7895 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7896 PolygonType v4; // al@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7897 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7898 signed __int64 v6; // qax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7899 PolygonType v7; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7900 int v8; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7901 int v9; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7902 unsigned int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7903 double v11; // st6@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7904 int v12; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7905 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7906 char *v14; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7907 void *v15; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7908 int v16; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7909 int v17; // edi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7910 double v18; // st7@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7911 signed int v19; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7912 void *v20; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7913 int v21; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7914 int v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7915 signed __int64 v23; // qtt@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7916 double v24; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7917 unsigned __int8 v25; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7918 unsigned __int8 v26; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7919 Render *v27; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7920 double v28; // st7@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7921 char *v29; // ebx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7922 char *v30; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7923 unsigned __int8 v31; // c0@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7924 unsigned __int8 v32; // c3@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7925 double v33; // st6@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7926 char *v34; // esi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7927 const void *v35; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7928 int v36; // eax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7929 const void *v37; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7930 signed __int64 v38; // qax@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7931 int v39; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7932 int v40; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7933 int v41; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7934 signed __int64 v42; // qtt@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7935 int v43; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7936 char v44; // zf@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7937 double v45; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7938 double v46; // st7@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7939 unsigned int v47; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7940 double v48; // st7@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7941 RenderVertexSoft *v49; // ebx@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7942 void *v50; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7943 double v51; // st7@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7944 RenderVertexSoft *v52; // edx@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7945 void *v53; // edi@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7946 char *v54; // ebx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7947 unsigned int v55; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7948 unsigned int v56; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7949 int v57; // ST10_4@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7950 Texture *v58; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7951 signed int v59; // [sp-4h] [bp-178h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7952 stru148 *v60; // [sp+0h] [bp-174h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7953 IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7954 stru148 v62; // [sp+14h] [bp-160h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7955 unsigned int v63; // [sp+120h] [bp-54h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7956 double v64; // [sp+124h] [bp-50h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7957 unsigned int v65; // [sp+128h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7958 unsigned int v66; // [sp+12Ch] [bp-48h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7959 float v67; // [sp+130h] [bp-44h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7960 __int64 v68; // [sp+134h] [bp-40h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7961 __int64 v69; // [sp+13Ch] [bp-38h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7962 int v70; // [sp+144h] [bp-30h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7963 int X; // [sp+148h] [bp-2Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7964 int v72; // [sp+14Ch] [bp-28h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7965 float v73; // [sp+150h] [bp-24h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7966 unsigned int v74; // [sp+154h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7967 RenderVertexSoft *v75; // [sp+158h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7968 float v76; // [sp+15Ch] [bp-18h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7969 int v77; // [sp+160h] [bp-14h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7970 int v78; // [sp+164h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7971 void *v79; // [sp+168h] [bp-Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7972 float v80; // [sp+16Ch] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7973 const void *v81; // [sp+170h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7974
68
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
7975 __debugbreak();
fdacbc653945 BLV render: first image
Nomad
parents: 59
diff changeset
7976
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7977 pFace = &pIndoor->pFaces[uFaceID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7978 v65 = uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7979 v3 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7980 v4 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7981 if ( v4 == POLYGON_InBetweenFloorAndWall || v4 == POLYGON_Floor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7983 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7985 v54 = (char *)&array_507D30[0].u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7986 LODWORD(v80) = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7987 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7989 v69 = (GetTickCount() >> 5) - pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7990 *(float *)v54 = (double)v69 + *(float *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7991 *(float *)v54 = *(float *)v54 * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7992 v55 = GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7993 v54 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7994 v44 = LODWORD(v80)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7995 v68 = pBLVRenderParams->vPartyPos.y + (v55 >> 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7996 *((float *)v54 - 11) = ((double)v68 + *((float *)v54 - 11)) * 0.25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7998 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7999 uFaceID = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8001 v56 = 8 * uFaceID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8002 LOBYTE(v56) = 8 * uFaceID | 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8003 v57 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8004 v58 = pFace->GetTexture();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8005 pRenderer->DrawIndoorPolygon(v3, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], v58, v57, -1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8006 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8008 HIDWORD(v69) = pIndoorCamera->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8009 HIDWORD(v68) = pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8010 *(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8011 v70 = (signed __int64)((double)(pBLVRenderParams->field_40 * pBLVRenderParams->vPartyPos.z)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8012 / (((double)pBLVRenderParams->field_40 + 16192.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8013 * 65536.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8014 + *(float *)&v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8015 v5 = (double)pIndoorCamera->sRotationX * 0.0030664064;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8016 *(float *)&v75 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8017 v80 = cos(v5) * 16192.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8018 v6 = (signed __int64)(*(float *)&v74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8019 - (double)pBLVRenderParams->field_40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8020 / ((v80 + 0.0000001)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8021 * 65535.0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8022 * (sin(*(float *)&v75) * -16192.0 - (double)SHIDWORD(v68)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8023 v7 = pFace->uPolygonType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8024 if ( v7 == 4 || v7 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8025 v70 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8026 stru_8019C8._48653D(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8027 v62._48607B(&stru_8019C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8028 v62.uTileBitmapID = pFace->uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8029 v62.pTexture = (Texture *)((signed __int16)v62.uTileBitmapID != -1 ? (int)&pBitmaps_LOD->pTextures[(signed __int16)v62.uTileBitmapID] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8030 if ( !v62.pTexture )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8031 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8032 v8 = pBLVRenderParams->sPartyRotX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8033 v62.field_58 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8034 v62.uNumVertices = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8035 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8036 v62.v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8037 v62.v_18.x = -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8038 v62.v_18.z = -stru_5C6E00->SinCos(v8 + 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8039 v10 = pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8040 memcpy(&array_507D30[v3], array_507D30, sizeof(array_507D30[v3]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8041 LODWORD(v80) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8042 v62.field_24 = 33554432;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8043 v64 = (double)(signed int)v10 * 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8044 v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8045 LODWORD(v80) = v62.pTexture->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8046 v11 = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8047 LODWORD(v80) = v62.pTexture->uTextureHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8048 v12 = v62.pTexture->uWidthMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8049 v13 = v62.pTexture->uHeightMinus1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8050 v67 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8051 v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8052 v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8053 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8054 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8055 *((float *)&v68 + 1) = 1.0 / (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8056 if ( (signed int)v62.uNumVertices <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8058 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8059 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8060 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8061 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8062 v59 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8063 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8065 v14 = (char *)&array_507D30[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8066 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8068 v15 = (void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v14));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8069 LODWORD(v80) = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8070 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8071 v16 = v77 + v62.ptr_38->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8072 v77 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8073 v74 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8074 LODWORD(v80) = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8075 v77 = (unsigned __int64)(SLODWORD(v80) * (signed __int64)(signed int)v15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8076 v79 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8077 v75 = (RenderVertexSoft *)(v77 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8078 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8079 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v15) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8080 v17 = v72 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v14 - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8081 v18 = *(float *)v14 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8082 v19 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8083 v77 = -v62.field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8084 X = (int)((char *)v79 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8085 LODWORD(v76) = (signed __int64)v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8086 v20 = (void *)(v72 * (v70 - LODWORD(v76)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8087 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8088 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8089 v79 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8090 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8091 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8092 v21 = abs(v19 >> 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8093 if ( v21 <= abs(X) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8094 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8095 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8096 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8097 v19 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8098 v20 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8099 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8100 LODWORD(v80) = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8101 v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8102 v22 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8103 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8104 v20 = (char *)v20 + v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8105 X = v22 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8106 v78 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8107 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8108 if ( !v78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8109 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8110 LODWORD(v23) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8111 HIDWORD(v23) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8112 v79 = (void *)(v23 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8113 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8114 LODWORD(v80) = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8115 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8116 LODWORD(v76) = v74 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8117 LODWORD(v80) = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8118 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(SLODWORD(v80) * (signed __int64)v17) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8119 v77 = (unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8120 LODWORD(v73) = (unsigned __int64)((signed int)v75 * v23 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8121 v14 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8122 LODWORD(v80) = v66 + ((signed int)((unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8123 v81 = (char *)v81 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8124 v24 = (double)SLODWORD(v80) * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8125 LODWORD(v80) = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v23 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8126 v26 = __OFSUB__((int)v81, v62.uNumVertices);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8127 v25 = (signed int)((char *)v81 - v62.uNumVertices) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8128 *((float *)v14 - 10) = v24 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8129 *((float *)v14 - 9) = (double)SLODWORD(v80) * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8130 *((float *)v14 - 11) = 65536.0 / (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8131 if ( !(v25 ^ v26) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8132 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8133 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8135 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8137 LODWORD(v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8138 v80 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8139 if ( (signed int)v62.uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8141 v28 = (double)SLODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8142 LODWORD(v76) = (int)(char *)array_50AC10 + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8143 v29 = (char *)&array_50AC10[0].vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8144 v30 = (char *)&array_507D30[1].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8145 v79 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8146 v81 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8147 v78 = v62.uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8148 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8149 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8150 v31 = v28 < *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8151 v32 = v28 == *((float *)v30 - 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8152 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8153 memcpy(v79, v81, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8154 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8155 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8156 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8157 if ( v31 | v32 || v28 >= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8158 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8159 if ( v28 >= *((float *)v30 - 12) || v28 <= *(float *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8160 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8161 v33 = (*((float *)v30 - 1) - *((float *)v30 - 13)) * v28 / (*(float *)v30 - *((float *)v30 - 12))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8162 + *((float *)v30 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8164 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8166 v33 = (*((float *)v30 - 13) - *((float *)v30 - 1)) * v28 / (*((float *)v30 - 12) - *(float *)v30)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8167 + *((float *)v30 - 13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8169 *(float *)v29 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8170 v79 = (char *)v79 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8171 v29 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8172 ++LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8173 *(unsigned int *)LODWORD(v76) = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8174 LODWORD(v76) += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8175 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8176 v81 = (char *)v81 + 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8177 v30 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8178 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8180 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8182 if ( SLODWORD(v73) <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8183 goto LABEL_40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8184 v34 = (char *)&array_50AC10[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8185 v65 = v77 >> 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8186 HIDWORD(v69) = LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8187 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8189 v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v34));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8190 v78 = v62.ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8191 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8192 v36 = (int)((char *)v81 + v62.ptr_38->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8193 v81 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8194 v74 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8195 v78 = v62.ptr_38->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8196 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8197 v78 = (int)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8198 v75 = (RenderVertexSoft *)((char *)v81 + v62.ptr_38->field_18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8199 v81 = (const void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8200 v78 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8201 v37 = (const void *)(v72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8202 * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v34 - 1)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8203 v38 = (signed __int64)(*(float *)v34 - 1.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8204 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8205 LODWORD(v76) = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8206 v39 = v72 * (v70 - v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8207 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8209 v78 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8210 if ( !X )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8211 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8212 v40 = abs(X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8213 if ( abs((signed __int64)v65) <= v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8214 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8215 if ( SLODWORD(v76) <= (signed int)pViewport->uViewportY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8216 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8217 v39 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8218 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8219 v78 = v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8220 v41 = (unsigned __int64)(v62.v_18.z * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8221 --LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8222 v39 += v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8223 X = v41 + v62.v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8224 v81 = (const void *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8226 if ( v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8228 v79 = (void *)v62.v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8229 v78 = 2 * LODWORD(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8230 v81 = (const void *)((unsigned __int64)(v62.v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8231 * (signed __int64)(signed int)(signed __int64)(((double)v70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8232 - ((double)(2 * LODWORD(v76))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8233 - *(float *)v34))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8234 * (double)v72)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8235 X = (int)((char *)v81 + v62.v_18.x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8237 LODWORD(v42) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8238 HIDWORD(v42) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8239 v79 = (void *)(v42 / X);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8240 v81 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8241 v78 = v62.ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8242 v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8243 v43 = v74 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8244 v74 = (unsigned int)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8245 LODWORD(v76) = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8246 v78 = v62.ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8247 v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8248 v74 = (unsigned __int64)(v43 * v42 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8249 v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8250 v34 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8251 v78 = v66 + ((signed int)v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8252 v44 = HIDWORD(v69)-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8253 v45 = (double)v78 * 0.000015259022;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8254 v78 = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v42 / X) >> 16) >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8255 *((float *)v34 - 10) = v45 * v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8256 *((float *)v34 - 9) = (double)v78 * 0.000015259022 * *((float *)&v68 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8257 v46 = (double)(signed int)v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8258 *((float *)v34 - 16) = 0.000015258789 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8259 *((float *)v34 - 11) = 65536.0 / v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8261 while ( !v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8262 LABEL_40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8263 v47 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8264 if ( SLODWORD(v73) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8266 v48 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8267 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8268 v49 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8269 HIDWORD(v69) = LODWORD(v73);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8270 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8272 if ( v48 >= v49->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8274 v50 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8275 ++v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8276 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8277 memcpy(v50, v49, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8279 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8280 --HIDWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8282 while ( HIDWORD(v69) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8284 v62.uNumVertices = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8285 pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8286 *(float *)&v74 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8287 if ( SLODWORD(v73) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8289 v51 = (double)SLODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8290 v75 = array_507D30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8291 v52 = array_50AC10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8292 v80 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8293 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8295 if ( v51 <= v52->vWorldViewProjY )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8296 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8297 v53 = v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8298 ++v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8299 ++v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8300 memcpy(v53, v52, 0x30u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8302 ++v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8303 --LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8305 while ( v80 != 0.0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8307 v62.uNumVertices = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8308 v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8309 v60 = &v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8310 v59 = v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8311 v27 = pRenderer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8312 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8313 v27->_4A2ED5(v59, v60, v61);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8315
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8316 //----- (0047A384) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8317 void ODM_LoadAndInitialize(const char *pLevelFilename, OutdoorCamera *thisa)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8318 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8319 int v2; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8320 unsigned int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8321 MapInfo *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8322 int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8323 SpawnPointMM7 *v6; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8324 size_t v7; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8325 char *v8; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8326 char *v9; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8327 char Source[120]; // [sp+Ch] [bp-84h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8328 const char *pFilename; // [sp+84h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8329 unsigned int v12; // [sp+88h] [bp-8h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8330 int v13; // [sp+8Ch] [bp-4h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8331
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8332 pFilename = pLevelFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8333 thisa->AllocSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8334 pOutdoorCamera->_485F64();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8335 pWeather->bRenderSnow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8336 pRenderer->ClearZBuffer(0, 479);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8337 thisa = (OutdoorCamera *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8338 GetAlertStatus();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8339 if ( qword_A750D8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8340 qword_A750D8 = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8341 v2 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8342 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8343 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8345 v4 = &pMapStats->pInfos[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8346 v3 = v4->uRespawnIntervalDays;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8348 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8349 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8350 v4 = (MapInfo *)thisa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8352 day_attrib &= 0xFFFFFFFEu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8353 dword_6BE13C_uCurrentlyLoadedLocationID = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8354 pOutdoor->Initialize(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8355 pFilename,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8356 (unsigned int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 0x3C / 0x3C / 0x18 + 1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8357 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8358 (int)&thisa);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8359 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8360 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8361 UpdateActors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8362 UpdateLayingItems();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8364 BYTE1(dword_6BE364_game_settings_1) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8365 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8366 if ( !v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8367 thisa = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8368 if ( thisa == (OutdoorCamera *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8370 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8371 if ( (signed int)pOutdoor->uNumSpawnPoints > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8373 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8374 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8376 v6 = &pOutdoor->pSpawnPoints[v12 / 0x18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8377 if ( pOutdoor->pSpawnPoints[v12 / 0x18].uKind == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8378 SpawnEncounter(v4, v6, v5, v5, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8379 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8380 v4->SpawnRandomTreasure(v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8381 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8382 v12 += 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8383 if ( v13 >= (signed int)pOutdoor->uNumSpawnPoints )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8384 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8385 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8388 RespawnGlobalDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8390 pOutdoor->PrepareDecorations();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8391 pOutdoor->_47F223_LooksLikeGenerateMonsterLoot();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8392 pOutdoor->InitalizeActors(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8393 pOutdoor->MessWithLUN();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8394 v7 = strlen("levels\\");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8395 strcpy(Source, &pFilename[v7]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8396 strcpy(pOutdoor->pLevelFilename, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8397 pWeather->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8398 pIndoorCamera->sRotationY = pParty->sRotationY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8399 pIndoorCamera->sRotationX = pParty->sRotationX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8400 pOutdoorCamera->RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8401 pOutdoor->UpdateSunlightVectors();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8402 pOutdoorCamera->int_fov_rad = (signed __int64)pIndoorCamera->flt_1C_fov;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8403 pOutdoorCamera->int_fov_rad_inv = (signed __int64)pIndoorCamera->flt_20_inv_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8404 v8 = (char *)&array_77EC08[0].ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8405 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8407 *(int *)v8 = (int)&stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8408 v8 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8410 while ( (signed int)v8 < (signed int)&unk_801A00 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8411 v9 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8412 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8414 *((int *)v9 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8415 *(int *)v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8416 *((int *)v9 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8417 v9 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8419 while ( (signed int)v9 < (signed int)&unk_801A0C );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8420 MM7Initialization();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8421 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8422
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8423
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8424
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8425 //----- (0047A825) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8426 bool LevelDecoration::_47A825()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8428 bool v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8429 LevelDecoration *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8430
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8431 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8432 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8433 if ( pParty->uCurrentHour >= 1 || (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 178) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8435 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8437 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8439 if ( (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 164)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8440 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 165)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8441 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 166)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8442 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 167)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8443 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 168)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8444 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 169)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8445 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 170)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8446 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 171)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8447 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 172)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8448 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 173)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8449 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 174)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8450 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 175)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8451 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 176)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8452 && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 177) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8453 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8454 v1 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8455 LOBYTE(v2->field_2) &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8456 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8459 LOBYTE(v2->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8460 return v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8462
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8463
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8464
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8465 //----- (0047BC6F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8466 unsigned __int16 *__fastcall GetBillboardPalette(RenderBillboard *a1, int a2, signed int a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8468 int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8469 int v6; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8470 int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8471 signed int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8472 signed __int64 v9; // qtt@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8473 signed int v10; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8474 int v11; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8475 signed __int64 v12; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8476 double v13; // ST10_8@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8477 int v14; // edi@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8478 signed int v15; // edx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8479 signed __int64 v16; // qtt@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8480 signed int v17; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8481 int v18; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8482 float a3a; // [sp+20h] [bp+8h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8483
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8484 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8485 v18 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8486 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8487 return PaletteManager::Get(a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8488 if ( !pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8489 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8490 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8492 v14 = day_fogrange_1 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8493 if ( a3 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8495 if ( a3 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8496 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8497 LODWORD(v16) = (a3 - v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8498 HIDWORD(v16) = (a3 - v14) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8499 v15 = (unsigned __int64)(27 * v16 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8501 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8503 v15 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8506 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8508 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8509 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
8510 v17 = _43F55F_get_billboard_light_level(a1, v15);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8511 if ( v17 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8512 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8513 if ( !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8514 v17 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8515 v7 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8516 v6 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8517 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8518 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8519 v11 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8520 if ( a4 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8521 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8522 LODWORD(v12) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8523 HIDWORD(v12) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8524 a3a = (double)(signed int)(((unsigned __int64)(11 * v12 / (pOutdoorCamera->shading_dist_shade << 16)) >> 16) + 20)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8525 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8526 v13 = a3a + 6.7553994e15;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
8527 v10 = _43F55F_get_billboard_light_level(a1, LODWORD(v13) + v11);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8528 if ( v10 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8529 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8530 if ( v10 < a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8531 v10 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8532 if ( v10 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8533 v10 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8534 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8535 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8536 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8537 if ( pWeather->field_FA0 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8539 v8 = 67108864;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8540 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8541 v8 = pParty->pPartyBuffs[16].uPower << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8542 if ( a3 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8544 if ( a3 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8546 LODWORD(v9) = a3 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8547 HIDWORD(v9) = a3 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8548 v6 = (unsigned __int64)(27 * v9 / v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8551 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8553 v6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8554 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
8555 v10 = _43F55F_get_billboard_light_level(a1, v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8556 if ( v10 > 27 || !a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8557 v10 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8558 return PaletteManager::Get_Dark_or_Red_LUT(v4, v10, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8560 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8561 return (unsigned __int16 *)PaletteManager::Get_Mist_or_Red_LUT(v7, v6, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8563 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8564 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8565 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8566
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8567
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8568
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8569
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8570
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8571
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8572
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8573
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8574 //----- (0047BEB1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8575 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
8576 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8577 stru148 *v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8578 signed int v9; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8579 int v10; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8580 signed int v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8581 signed int v12; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8582 signed __int64 v13; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8583 int *v14; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8584 int *v15; // edi@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8585 int v16; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8586 signed __int64 v17; // qtt@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8587 double v18; // ST10_8@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8588 double v19; // ST10_8@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8589 int v20; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8590 int result; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8591 int *v22; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8592 signed int v23; // edx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8593 signed __int64 v24; // qtt@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8594 int v25; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8595 signed int v26; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8596 float v27; // [sp+28h] [bp+10h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8597 float v28; // [sp+28h] [bp+10h]@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8598 int v29; // [sp+2Ch] [bp+14h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8600 v8 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8601 v9 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8602 v26 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8603 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8605 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8606 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8607 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8608 LABEL_46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8609 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8610 *(char *)a8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8611 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8613 if ( a1 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8614 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8615 v26 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8616 v9 = v8->field_34 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8617 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8618 v10 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8619 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8620 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8621 if ( !v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8623 if ( !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8625 v14 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8626 v15 = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8627 if ( !v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8629 *a5 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8630 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8632 v16 = v8->field_58 - terrain_gamma;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8633 if ( v16 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8635 if ( v16 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8636 v16 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8638 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8640 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8642 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8643 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8645 v28 = pOutdoor->fFogDensity * 27.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8646 v19 = v28 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8647 v29 = LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8649 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8651 LODWORD(v17) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8652 HIDWORD(v17) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8653 v27 = (double)(signed int)(((unsigned __int64)(v17 / (pOutdoorCamera->shading_dist_shade << 16) * (31 - *a6)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8654 + *a6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8655 * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8656 v18 = v27 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8657 v29 = LODWORD(v18);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8659 *v14 = v16 + v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8660 v20 = *v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8661 if ( v16 + v29 > v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8662 *v14 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8663 if ( *v14 < v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8664 *v14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8665 if ( *v14 > pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8666 *v14 = pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8667 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8669 if ( v9 >= day_fogrange_1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8671 if ( v9 <= day_fogrange_2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8672 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8673 v23 = v9 - (day_fogrange_1 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8674 LODWORD(v24) = v23 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8675 HIDWORD(v24) = v23 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8676 v25 = (unsigned __int64)(27 * v24 / ((day_fogrange_2 - day_fogrange_1) << 16)) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8677 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8678 *a5 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8679 if ( v25 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8680 goto LABEL_54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8681 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8683 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8685 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8686 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8689 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8691 v22 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8692 *a5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8694 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8696 LABEL_55:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8697 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8698 *v22 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8699 *a6 = 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8700 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8701 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8703 LABEL_54:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8704 *v22 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8705 goto LABEL_55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8706 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8707 if ( v10 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8709 v11 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8710 if ( byte_4D864C && BYTE1(pGame->uFlags) & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8712 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8714 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8716 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8718 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8719 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8720 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8721 v11 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8722 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8723 v12 = v11 << 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8724 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8725 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8726 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8727 if ( v9 <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8728 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8729 if ( v9 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8731 LODWORD(v13) = v9 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8732 HIDWORD(v13) = v9 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8733 v9 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8734 *a5 = (unsigned __int64)(27 * v13 / v12) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8736 if ( *a5 > 27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8737 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8739 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8741 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8743 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8745 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8746 if ( v8->field_32 & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8747 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8748 *a6 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8749 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8750 *(char *)a7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8751 goto LABEL_46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8753 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8754 *a5 = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8755 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8757 *a5 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8758 *a6 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8759 *(char *)a7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8760 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8761 result = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8762 *(char *)a8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8763 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8764 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8765 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8766 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8767 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8768 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8769 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8770
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8771 //----- (0047C178) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8772 void *__fastcall sr_sub_47C178(signed int a1, stru148 *a2, int terrain_gamma, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8773 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8774 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8775 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8776 int v6; // [sp+4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8777 int v7; // [sp+8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8778
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8779 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8780 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8781 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8782 result = PaletteManager::Get(a2->pTexture->palette_id2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8784 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8786 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
8787 result = sr_sub_47C1CA(v4, SBYTE3(a4), v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8788 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8789 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8790 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8791
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8792 //----- (0047C1CA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8793 void *__fastcall sr_sub_47C1CA(stru148 *a1, char a2, int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8795 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8796 void *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8797 int v6; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8798 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8799 int a3a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8800 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8801
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8802 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8803 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8804 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8805 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8806 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8807 result = PaletteManager::Get(a1->pTexture->palette_id2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8809 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8811 v6 = pGame->_44EC23(a1, &a3a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8812 if ( v6 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8813 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8814 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8815 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8816 if ( v6 != -1 || a4 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8817 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8818 v7 = v4->pTexture->palette_id2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8820 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8822 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8823 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8825 result = PaletteManager::Get_Mist_or_Red_LUT(v7, v6, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8827 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8828 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8829 result = PaletteManager::Get_Dark_or_Red_LUT(v4->pTexture->palette_id2, v6, a3a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8832 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8835 //----- (0047C24C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8836 unsigned __int16 *__fastcall sr_sub_47C24C_get_palette(BLVFace *a1, int a2, int a3, char a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8837 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8838 int v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8839 int v5; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8840 int a3a; // [sp+4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8841
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8842 v4 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8843 a3a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8844 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8846 v5 = pGame->_44ED0A(a1, &a3a, 31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8847 if ( v5 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8848 a3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8850 return PaletteManager::Get_Dark_or_Red_LUT(v4, a3, a3a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8852
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8853 //----- (0047C28C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8854 char *__fastcall sr_sub_47C28C_get_palette(stru148 *a1, char a2, signed int a3, signed int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8855 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8856 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8857 char *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8858 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8859 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8860 int a2a; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8861 char v9; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8862
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8863 v9 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8864 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8865 a2a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8866 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8867 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8868 result = (char *)pPaletteManager->field_199600_palettes[a1->pTexture->palette_id2];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8870 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8872 v6 = pGame->_44EC23(a1, &a2a, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8873 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8874 a3 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8875 if ( v9 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8876 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8877 if ( a3 != -1 || a4 != -1 )
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8878 v7 = v4->pTexture->palette_id2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8879 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8880 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8881 result = (char *)PaletteManager::_47C30E_get_palette(v7, a2a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8883 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8884 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
8885 result = (char *)PaletteManager::_47C33F_get_palette(v4->pTexture->palette_id2, a2a);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8886 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8887 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8888 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8890
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8891 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8892
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8893
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8894 //----- (0047C370) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8895 unsigned int __cdecl GetLevelFogColor()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8896 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8897 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8898 signed __int64 v1; // qax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8899 int v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8900
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8901 if ( bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8903 result = 0xFF258F5Cu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8904 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8905 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8907 if ( day_attrib & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8909 if ( pWeather->field_FA0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8910 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8911 v2 = -(pWeather->field_FA0 != 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8912 result = (v2 & 0xE0E0E1) - 0xE0E0E1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8914 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8916 v1 = (signed __int64)((1.0 - pOutdoor->fFogDensity) * 200.0 + pOutdoor->fFogDensity * 31.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8917 result = v1 | (((unsigned int)v1 | (((unsigned int)v1 | 0xFFFFFF00) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8918 }
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 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8924 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8925 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8927 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8928 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8929
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8930 //----- (0047C3D7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8931 int __fastcall sub_47C3D7_get_fog_related_stuff(int a1, int a2, float a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8932 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8933 int v3; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8934 double v5; // st7@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8935 signed int v6; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8936 signed int v7; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8937 double v8; // st6@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8938 double v9; // st7@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8939 double v10; // st6@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8940 float v11; // ST14_4@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8941 double v12; // ST08_8@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8942
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8943 v3 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8944 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8945 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8946 if ( pParty->field_1613C || !(day_attrib & 1) && !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8947 return 0xFF000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8948 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8949 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8950 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8951 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8952 v5 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8953 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8954 if ( a3 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8955 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8956 v8 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8957 if ( a3 > v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8959 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8960 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8961 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8962 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8963 v7 = (signed __int64)((a3 - v5) / (v8 - v5) * 216.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8965 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8967 v9 = (double)day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8968 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8969 if ( a3 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8971 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8972 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8973 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8974 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8975 v10 = (double)day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8976 if ( a3 > v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8977 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8978 v11 = (a3 - v9) * 216.0 / (v10 - v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8979 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8980 v7 = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8982 if ( v7 > v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8984 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8985 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8986 goto LABEL_21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8988 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8989 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8990 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8991 LABEL_21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8992 if ( a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8993 v7 = 248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8994 return (-1 - v7) << 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8996 // 6BE030: using guessed type int day_attrib;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8997 // 6BE040: using guessed type int day_fogrange_1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8998 // 6BE044: using guessed type int day_fogrange_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8999 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9001 //----- (0047C4FC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9002 signed int __fastcall GetActorTintColor(int a1, int a2, float a3, int a4, RenderBillboard *a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9003 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9004 int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9005 signed int v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9006 signed int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9007 int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9008 double v9; // st7@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9009 double v10; // ST0C_8@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9010 int v11; // ecx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9011 signed int v12; // edi@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9012 double v13; // ST0C_8@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9013 double v14; // ST0C_8@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9014 double v15; // st7@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9015 double v16; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9016 double v17; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9017 int v18; // ST14_4@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9018 double v19; // ST0C_8@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9019 signed int v20; // [sp+10h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9020 float a3a; // [sp+1Ch] [bp+8h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9021 float a3b; // [sp+1Ch] [bp+8h]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9022 float a3c; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9023 float a3d; // [sp+1Ch] [bp+8h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9024 float a4b; // [sp+20h] [bp+Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9025 int a4a; // [sp+20h] [bp+Ch]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9026 float a4c; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9027 float a4d; // [sp+20h] [bp+Ch]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9028 int a5a; // [sp+24h] [bp+10h]@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9029
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9030 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9031 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9032 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9033 return 8 * (31 - a1) | ((8 * (31 - a1) | ((31 - a1) << 11)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9034 v8 = pWeather->field_FA0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9035 if ( bUnderwater == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9036 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9037 if ( pParty->field_1613C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9038 return 16711680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9039 if ( v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9040 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9041 if ( v8 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9042 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9043 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9044 if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9045 v20 = pParty->pPartyBuffs[16].uPower;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9046 v9 = (double)v20 * 1024.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9047 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9048 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9049 if ( a3 <= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9051 if ( a3 > 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9053 a4b = a3 * 216.0 / v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9054 v10 = a4b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9055 v6 = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9056 if ( SLODWORD(v10) > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9057 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9060 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9061 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9062 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9063 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9064 if ( a3 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9066 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9067 if ( a5 )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
9068 v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9069 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9070 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9071 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9073 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9074 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9075 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9077 if ( a3 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9079 result = (signed int)0xF8F8F8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9081 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9083 v11 = 8 * (a1 - v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9084 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9085 if ( v11 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9087 if ( v11 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9088 v12 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9090 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9092 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9093 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9094 if ( a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9095 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9096 a3b = pOutdoor->fFogDensity * 216.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9097 v14 = a3b + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9098 a4a = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9100 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9102 a3a = (a3 / (double)pOutdoorCamera->shading_dist_shade * 32.0 + 216.0) * pOutdoor->fFogDensity;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9103 v13 = a3a + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9104 a4a = LODWORD(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9106 v6 = a4a + v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9107 if ( a5 )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
9108 v6 = 8 * _43F55F_get_billboard_light_level(a5, v6 >> 3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9109 if ( v6 > 216 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9110 v6 = 216;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9111 if ( v6 < v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9112 v6 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9113 if ( v6 > 8 * pOutdoor->field_CBC_terrain_triangles_shade_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9114 v6 = 8 * pOutdoor->field_CBC_terrain_triangles_shade_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9115 if ( !bUnderwater )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9116 return (255 - v6) | ((255 - v6) << 16) | ((255 - v6) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9117 v15 = (double)(255 - v6) * 0.0039215689;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9118 a3c = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9119 a4c = v15 * 16.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9120 v16 = a4c + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9121 a5a = LODWORD(v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9122 a4d = a3c * 194.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9123 v17 = a4d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9124 v18 = LODWORD(v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9125 a3d = a3c * 153.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9126 v19 = a3d + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9127 result = LODWORD(v19) | ((v18 | (a5a << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9129 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9131 // 6BE3C4: using guessed type char bUnderwater;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9134
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9135
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9136 //----- (0047F44B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9137 int __stdcall WorldPosToGridCellX(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9139 return (a1 >> 9) + 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9141 // 47F44B: using guessed type int __stdcall WorldPosToGridCellX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9143 //----- (0047F458) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9144 int __stdcall WorldPosToGridCellZ(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9146 return 64 - (a1 >> 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9148 // 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9149
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9150 //----- (0047F469) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9151 int __stdcall GridCellToWorldPosX(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9153 return (a1 - 64) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9155 // 47F469: using guessed type int __stdcall GridCellToWorldPosX(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9156
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9157 //----- (0047F476) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9158 int __stdcall GridCellToWorldPosZ(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9160 return (64 - a1) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9161 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9162 // 47F476: using guessed type int __stdcall GridCellToWorldPosZ(int);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9164 //----- (0047F4D3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9165 void __fastcall sub_47F4D3(int band1, int band2, int band3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9166 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9167 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9168 stru220 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9169 double v5; // ST2C_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9170 double v6; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9171 double v7; // [sp+18h] [bp-28h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9172 double v8; // [sp+20h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9173 int v9; // [sp+34h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9174 int v10; // [sp+38h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9175 signed int band3a; // [sp+48h] [bp+8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9177 v9 = band2 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9178 pOutdoorCamera->outdoor_grid_band_3 = band3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9179 v10 = band1 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9180 v3 = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9181 pOutdoorCamera->uPickDepth = band3 << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9182 v4 = stru_76E5C8; // v4: 0 -> 65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9183 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9185 band3a = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9186 v8 = (double)(signed int)((char *)v4 + 256 - (int)stru_76E5C8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9187 do // band3a: 0 -> 128
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9189 v5 = pow((double)band3a, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9190 v6 = pow(v8, 2.0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9191 *((float *)&v5 + 1) = sqrt(v6 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9192 v7 = *((float *)&v5 + 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9193 if ( SLODWORD(v7) >= v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9195 if ( SLODWORD(v7) >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9196 v4->field_0 = ((SLODWORD(v7) >= v3) - 1) & 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9197 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9198 v4->field_0 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9200 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9201 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9202 v4->field_0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9204 band3a += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9205 v4->distance = LOWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9206 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9208 while ( band3a < 65792 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9209 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9210 while ( (signed int)v4 < (signed int)arary_77E5C8 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9216 //----- (004811A3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9217 void stru148::_4811A3()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9219 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9220 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9221 pBitmaps_LOD->pHardwareTextures[pRenderer->pHDWaterBitmapIDs[pRenderer->field_1036A8_bitmapid]],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9222 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9223
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9224 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9225 pRenderer->DrawTerrainPolygon(uNumVertices, this,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9226 pBitmaps_LOD->pHardwareTextures[uTileBitmapID],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9227 1, 1);
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
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9232 //----- (00481DB2) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9233 char __fastcall sr_sub_481DB2(RenderVertexSoft *a1, signed int a2, stru148 *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9235 int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9236 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9237 signed int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9238 char *v6; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9239 double v7; // ST14_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9240 double v8; // ST0C_8@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9241 char result; // al@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9242
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9243 if ( a2 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9245 v3 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9246 v4 = a3->uTileBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9247 a3->ptr_38 = &stru_8019C8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9248 a3->pTexture = (Texture *)(v4 != -1 ? (int)&pBitmaps_LOD->pTextures[v3] : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9249 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9250 if ( (signed int)a3->uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9252 v6 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9253 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9254 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9255 v7 = *((float *)v6 - 1) + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9256 dword_50B638[v5] = LODWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9257 v8 = *(float *)v6 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9258 v6 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9259 dword_50B570[v5++] = LODWORD(v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9261 while ( v5 < (signed int)a3->uNumVertices );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9263 result = sr_sub_486B4E_push_outdoor_edges(a1, dword_50B638, dword_50B570, a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9265 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9267 // 50B570: using guessed type int dword_50B570[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9268 // 50B638: using guessed type int dword_50B638[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9269
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9270
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9271
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9272 //----- (00481E55) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9273 void OutdoorCamera::Project(unsigned int uNumVertices)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9275 double v1; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9276 double v2; // st6@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9277 double v3; // st5@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9278 int v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9279 unsigned int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9280 double v6; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9281 double v7; // st3@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9282
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9283 if ( (signed int)uNumVertices > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9285 v1 = (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9286 v2 = (double)pViewport->uScreenCenterX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9287 v3 = (double)pViewport->uScreenCenterY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9288 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9289 v5 = uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9290 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9291 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9292 v6 = v1 * array_507D30[v4].flt_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9293 v7 = v6 * array_507D30[v4].vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9294 memcpy(&array_50AC10[v4], &array_507D30[v4], sizeof(array_50AC10[v4]));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9295 array_50AC10[v4].vWorldViewProjX = v2 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9296 array_50AC10[v4].vWorldViewProjY = v3 - v6 * array_507D30[v4].vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9297 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9298 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9300 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9301 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9303
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9304 //----- (00481EB7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9305 void __cdecl ResetStru148s()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9307 int v0; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9308 char *v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9310 v0 = pOutdoorCamera->numStru148s;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9311 if ( pOutdoorCamera->numStru148s > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9313 v1 = (char *)&array_77EC08[0].prolly_tail;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9314 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9316 *((int *)v1 - 1) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9317 *(int *)v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9318 *((int *)v1 - 5) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9319 v1 += 268;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9320 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9321 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9322 while ( v0 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9323 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9324 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9325
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9326 //----- (00481ED9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9327 void __cdecl sub_481ED9_MessWithOutdoorCamera()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9329 stru_8019C8._48616B(65536, 0, 0, 0, 65536, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9330 pOutdoorCamera->numStru148s = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9331 pOutdoorCamera->uNumEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9332 pOutdoorCamera->uNumSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9333 pOutdoorCamera->uNumSurfs = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
9334 pOutdoorCamera->uNumBillboards = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9335 pOutdoorCamera->field_44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9337
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9338 //----- (00481EFA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9339 bool __fastcall sub_481EFA(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, RenderVertexSoft *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9341 RenderVertexSoft *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9342 RenderVertexSoft *v6; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9343 bool v7; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9344 bool v8; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9345 bool v9; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9346 bool v10; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9347 double v11; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9348 signed int v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9349 signed int v13; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9350 signed int v14; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9351 signed int v15; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9352 RenderVertexSoft *v17; // [sp+Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9354 v5 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9355 v6 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9356 v17 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9357 v7 = a1->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9358 v8 = v5->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9359 v9 = a3->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9360 v10 = a4->vWorldViewPosition.x < 8.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9361 return !(v8 & v9 & v10 & v7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9362 && ((v11 = (double)pOutdoorCamera->shading_dist_mist, v11 > v6->vWorldViewPosition.x) ? (v12 = 0) : (v12 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9363 v11 > v17->vWorldViewPosition.x ? (v13 = 0) : (v13 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9364 v11 > a3->vWorldViewPosition.x ? (v14 = 0) : (v14 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9365 v11 > a4->vWorldViewPosition.x ? (v15 = 0) : (v15 = 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9366 !(v13 & v14 & v15 & v12));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9368
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9369 //----- (00481FC9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9370 int __fastcall sub_481FC9(RenderVertexSoft *_ECX, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9372 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9373 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9374 /*signed int result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9375 __int64 v11; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9376 __int64 v12; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9377 __int64 v13; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9378 __int64 v14; // ST08_8@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9379
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9380 __asm { fld dword ptr [ecx+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9381 _ESI = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9382 _EDX = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9383 __asm { fcomp dword ptr [esi+8] }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9384 _EDI = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9385 __asm { fnstsw ax }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9386 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9387 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9388 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9390 fld dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9391 fcomp dword ptr [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9392 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9394 if ( !__SETP__(HIBYTE(_AX) & 0x44, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9395 *(int *)&a4->flags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9397 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9399 fld dword ptr [ecx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9400 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9401 fstp [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9402 fld dword ptr [ecx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9403 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9404 fstp [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9405 fld dword ptr [ecx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9406 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9407 fstp [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9408 fld dword ptr [edx+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9409 fsub dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9410 fstp [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9411 fld dword ptr [edx+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9412 fsub dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9413 fstp [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9414 fld dword ptr [edx+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9415 fsub dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9416 fstp [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9417 fld dword ptr [ecx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9418 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9419 fld dword ptr [ecx+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9420 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9421 fld dword ptr [ecx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9422 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9423 fld dword ptr [edx]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9424 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9425 fld dword ptr [edx+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9426 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9427 fld dword ptr [edx+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9428 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9429 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9430 fld st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9431 fmul st, st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9432 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9433 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9434 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9435 fild pIndoorCamera->pos.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9436 fsub dword ptr [esi]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9437 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9438 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9439 fmul st, st(6)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9440 fld st(3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9441 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9442 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9443 fild pIndoorCamera->pos.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9444 fsub dword ptr [esi+4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9445 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9446 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9447 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9448 fmul st, st(5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9449 fld st(2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9450 fmul st, st(7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9451 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9452 fild pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9453 fsub dword ptr [esi+8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9454 fmulp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9455 faddp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9456 fcomp ds:flt_4D84E8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9457 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9458 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9459 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9460 fnstsw ax
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9461 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9462 fstp st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9463 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9464 if ( __SETP__(HIBYTE(_AX) & 0x41, 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9466 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9467 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9468 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9469 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9470 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9471 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9472 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9473 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9474 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9475 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9476 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9477 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9478 fmul [ebp+arg_0]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9479 fld [ebp+var_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9480 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9482 _EDI->v_18.x = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9483 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9485 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9486 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9487 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9488 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9489 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9490 fld [ebp+var_8]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9491 fmul [ebp+var_C]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9492 fld [ebp+var_10]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9493 fmul [ebp+var_14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9495 _EDI->v_18.y = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9496 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9498 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9499 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9500 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9501 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9502 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9504 _EDI->v_18.z = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9505 stru148::_486089_normalize_v_18(_EDI);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9506 __asm
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9508 fild dword ptr [edi+18h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9509 fmul dword ptr [esi+0Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9510 fchs
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9511 fild dword ptr [edi+1Ch]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9512 fmul dword ptr [esi+10h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9513 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9514 fild dword ptr [edi+20h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9515 fmul dword ptr [esi+14h]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9516 fsubp st(1), st
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9517 fstp [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9518 fld [ebp+arg_4]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9519 fadd ds:flt_4D87D0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9520 fstp [ebp+var_20]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9522 _EDI->field_24 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9523 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9524 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9525 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9527 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9529 return result;*/
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9531
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9532
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9533
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9534 //----- (004823F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9535 bool __fastcall GetTerrainHeightsAroundParty(int a1, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9536 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9537 unsigned int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9538 unsigned int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9539 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9540 int v6; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9541 int v7; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9542 int v8; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9543 int v9; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9544 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9545 int v11; // [sp+14h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9546 int v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9547
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9548 v12 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9549 v11 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9550 v2 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9551 v3 = WorldPosToGridCellZ(v11) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9552 dword_76D568_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9553 dword_76D56C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9554 dword_76D570_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9555 dword_76D574_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9556 dword_76D558_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9557 dword_76D55C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9558 dword_76D560_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9559 dword_76D564_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9560 dword_76D548_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9561 dword_76D54C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9562 dword_76D550_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v2 + 1, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9563 v4 = pOutdoor->DoGetHeightOnTerrain(v2, v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9564 dword_76D554_terrain_cell_world_pos_around_party_y = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9565 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
9566 && 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
9567 && dword_76D550_terrain_cell_world_pos_around_party_y == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9568 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9569 v6 = abs(v12 - dword_76D568_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9570 if ( abs(dword_76D558_terrain_cell_world_pos_around_party_z - v11) >= v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9571 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9572 v7 = dword_76D554_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9573 v8 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9574 v9 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9576 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9578 v7 = dword_76D54C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9579 v8 = dword_76D548_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9580 v9 = dword_76D550_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9582 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9583 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9584 v10 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9585 if ( v8 < v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9586 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9587 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9588 v10 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9589 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9591 if ( v7 >= v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9592 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9593 v10 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9594 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9595 if ( v7 <= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9597 if ( v8 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9598 v9 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9600 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9601 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9602 if ( v7 > v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9603 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9604 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9605 return v9 - v10 > 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9607
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9608
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9609 //----- (0048257A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9610 int __fastcall GetTerrainHeightsAroundParty2(int a1, int a2, int *a3, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9611 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9612 unsigned int v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9613 unsigned int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9614 int result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9615 int v7; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9616 int v8; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9617 int v9; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9618 int v10; // ecx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9619 int v11; // [sp+Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9620 int v12; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9621 int v13; // [sp+10h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9622 signed int v14; // [sp+14h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9623 int v15; // [sp+24h] [bp+Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9624
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9625 v11 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9626 v12 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9627 v4 = WorldPosToGridCellX(a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9628 v5 = WorldPosToGridCellZ(v12) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9629 dword_76D538_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9630 dword_76D53C_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9631 dword_76D540_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9632 dword_76D544_terrain_cell_world_pos_around_party_x = GridCellToWorldPosX(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9633 dword_76D528_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9634 dword_76D52C_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9635 dword_76D530_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9636 dword_76D534_terrain_cell_world_pos_around_party_z = GridCellToWorldPosZ(v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9637 dword_76D518_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9638 dword_76D51C_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9639 dword_76D520_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4 + 1, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9640 dword_76D524_terrain_cell_world_pos_around_party_y = pOutdoor->DoGetHeightOnTerrain(v4, v5 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9641 *a3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9642 if ( pOutdoor->ActuallyGetSomeOtherTileInfo(v4, v5) & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9643 *a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9644 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9645 if ( !a4 && *a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9646 v14 = -60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9647 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
9648 || 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
9649 || 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
9650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9651 v7 = abs(v11 - dword_76D538_terrain_cell_world_pos_around_party_x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9652 if ( abs(dword_76D528_terrain_cell_world_pos_around_party_z - v12) >= v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9654 v8 = dword_76D524_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9655 v9 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9656 v10 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9657 v15 = v11 - dword_76D544_terrain_cell_world_pos_around_party_x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9658 v13 = v12 - dword_76D534_terrain_cell_world_pos_around_party_z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9660 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9662 v8 = dword_76D51C_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9663 v9 = dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9664 v10 = dword_76D520_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9665 v15 = dword_76D53C_terrain_cell_world_pos_around_party_x - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9666 v13 = dword_76D52C_terrain_cell_world_pos_around_party_z - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9668 result = v14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9669 + v8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9670 + ((unsigned __int64)(v13 * (signed __int64)((v10 - v8) << 7)) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9671 + ((unsigned __int64)(v15 * (signed __int64)((v9 - v8) << 7)) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9673 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9675 result = v14 + dword_76D518_terrain_cell_world_pos_around_party_y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9677 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9679
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9680
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9681 //----- (0048276F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9682 void stru148::_48276F_sr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9684 unsigned int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9685 float v2; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9686 double v3; // st7@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9687 char *v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9688 float v5; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9689 float v6; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9690 float v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9691 float v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9692 int i; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9693 int v10; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9694 RenderVertexSoft *v11; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9695 RenderVertexSoft *v12; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9696 RenderVertexSoft *v13; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9697 int v14; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9698 RenderVertexSoft *v15; // ebx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9699 double v16; // st6@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9700 double v17; // st5@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9701 double v18; // st4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9702 int v19; // [sp+4h] [bp-2Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9703 int v20; // [sp+8h] [bp-28h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9704 int v21; // [sp+Ch] [bp-24h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9705 stru148 *v22; // [sp+10h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9706 float v23; // [sp+14h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9707 float v24; // [sp+18h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9708 float v25; // [sp+1Ch] [bp-14h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9709 float v26; // [sp+20h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9710 float v27; // [sp+24h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9711 float v28; // [sp+28h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9712 float v29; // [sp+2Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9713
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9714 v1 = this->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9715 v22 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9716 if ( (signed int)v1 >= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9717 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9718 LODWORD(v2) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9719 v26 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9720 v28 = 10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9721 v3 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9722 v27 = -10000.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9723 if ( (signed int)v1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9724 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9725 v4 = (char *)&array_508690[0].vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9726 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9728 if ( *((float *)v4 - 1) < (double)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9730 LODWORD(v5) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9731 v25 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9732 v26 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9734 if ( *((float *)v4 - 1) > (double)v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9736 LODWORD(v6) = *((int *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9737 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9738 v27 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9739 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9740 if ( *(float *)v4 < (double)v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9741 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9742 LODWORD(v7) = *(int *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9743 v29 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9744 v28 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9746 if ( v3 < *(float *)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9748 v3 = *(float *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9749 v23 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9751 ++LODWORD(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9752 v4 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9754 while ( SLODWORD(v2) < (signed int)v1 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9755 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9756 v8 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9757 if ( LODWORD(v29) == LODWORD(v25) || LODWORD(v29) == LODWORD(v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9758 v8 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9759 v29 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9760 for ( i = 0; i < (signed int)v1; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9762 if ( i == LODWORD(v25) || i == LODWORD(v24) || i == LODWORD(v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9763 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9764 v10 = LODWORD(v29)++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9765 *(&v19 + v10) = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9768 v11 = &array_508690[v19];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9769 v12 = &array_508690[v20];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9770 v13 = &array_508690[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9771 if ( LODWORD(v29) != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9772 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9773 v11 = array_508690;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9774 v13 = (RenderVertexSoft *)((char *)array_508690 + 16 * (3 * v1 - 3));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9775 v12 = &array_508690[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9776 v28 = array_508690[1].vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9777 v27 = array_508690[1].vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9778 v29 = array_508690[1].vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9779 v26 = v13->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9780 v25 = v13->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9781 v24 = v13->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9782 if ( v24 * v27 - v25 * v29 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9784 if ( v26 * v29 - v24 * v28 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9786 if ( v25 * v28 - v26 * v27 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9788 v14 = v1 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9789 LODWORD(v26) = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9790 if ( v14 >= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9792 v15 = &array_508690[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9793 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9794 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9795 v16 = v15->vWorldPosition.x - array_508690[0].vWorldPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9796 v17 = v15->vWorldPosition.y - array_508690[0].vWorldPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9797 v18 = v15->vWorldPosition.z - array_508690[0].vWorldPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9798 v13 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9799 if ( v27 * v18 - v17 * v29 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9800 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9801 if ( v16 * v29 - v18 * v28 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9802 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9803 if ( v28 * v17 - v16 * v27 != 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9804 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9805 --LODWORD(v26);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9806 --v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9807 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9808 while ( SLODWORD(v26) >= 2 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9812 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9814 sr_sub_4829B9(v11, v12, v13, v22, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9817
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9818 //----- (004829B9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9819 stru148 *__fastcall sr_sub_4829B9(RenderVertexSoft *a1, RenderVertexSoft *a2, RenderVertexSoft *a3, stru148 *a4, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9821 double v5; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9822 RenderVertexSoft *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9823 double v7; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9824 stru148 *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9825 double v9; // st6@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9826 double v10; // st5@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9827 float v11; // ST0C_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9828 float v12; // ST04_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9829 double v13; // st4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9830 float v14; // [sp+8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9831 float v15; // [sp+10h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9832 float v16; // [sp+1Ch] [bp+8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9833 float v17; // [sp+1Ch] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9835 v5 = a2->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9836 v6 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9837 v16 = a3->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9838 v15 = a2->vWorldViewProjY - a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9839 v14 = v6->vWorldViewProjX - a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9840 v7 = v16 * v5 - v14 * v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9841 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9842 v7 = 0.0000001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9843 result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9844 v9 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9845 v10 = 1.0 / a1->vWorldViewPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9846 v11 = 1.0 / a2->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9847 v12 = 1.0 / v6->vWorldViewPosition.x - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9848 v13 = (v11 * v16 - v12 * v15) * v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9849 v17 = (v11 * v14 - v12 * v5) * -v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9850 a4->field_C = a1->vWorldViewProjX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9851 a4->field_10 = a1->vWorldViewProjY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9852 a4->field_0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9853 a4->field_8 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9854 a4->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9855 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9857
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9858 //----- (00482A90) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9859 signed int __cdecl const_1_0()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9861 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9863
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9864
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9865 //----- (00482A94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9866 int sr_sub_482A94(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9867 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9868 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9869 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9870 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9871 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9872 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9873 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9874 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9875 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9876 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9877 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9878 int v11; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9879 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9880 signed int v13; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9881 int v14; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9882 signed __int64 v15; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9883 stru149 *v16; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9884 signed int v17; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9885 Texture *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9886 unsigned __int16 *v19; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9887 stru149 *v20; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9888 signed int v21; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9889 int v22; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9890 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9891 Texture *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9892 signed int v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9893 signed int v27; // [sp-4h] [bp-A4h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9894 int v28; // [sp+Ch] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9895 int v29; // [sp+10h] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9896 stru316 a2; // [sp+14h] [bp-8Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9897 stru315 a1; // [sp+3Ch] [bp-64h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9898 int v32; // [sp+80h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9899 int v33; // [sp+84h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9900 int v34; // [sp+88h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9901 int v35; // [sp+8Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9902 int v36; // [sp+90h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9903 int v37; // [sp+94h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9904 int v38; // [sp+98h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9905 int X; // [sp+9Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9906
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9907 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9908 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9909 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9910 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9911 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9912 v37 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9913 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9914 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9915 v7 = v38 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9916 v37 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9917 v33 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9918 v8 = ((unsigned __int64)(v37 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9919 v38 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9920 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9921 v37 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9922 v38 = (unsigned __int64)(v37 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9923 v9 = v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9924 v28 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9925 v35 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9926 v10 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9927 v29 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9928 v32 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9929 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9930 v11 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9931 v37 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9932 v12 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9933 v13 = -v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9934 v36 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9935 X = ((unsigned __int64)(v37 * (signed __int64)v12) >> 16) + v38 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9936 if ( !X || (v14 = abs(v13 >> 14), v14 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9937 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9938 LODWORD(v15) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9939 HIDWORD(v15) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9940 v38 = v15 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9941 v16 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9942 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9943 v36 = v16->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9944 X = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9945 v36 = v33 + ((unsigned __int64)(v36 * (signed __int64)v37) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9946 v33 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9947 X = (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9948 v34 += (unsigned __int64)(v33 * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9949 v17 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9950 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9951 if ( v38 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9952 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9953 if ( v38 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9955 if ( v38 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9956 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9957 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9958 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9959 v27 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9961 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9963 v27 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9965 v17 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9966 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9968 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9969 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9970 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9971 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9972 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9974 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9975 if ( v17 < (signed int)v3->ptr_48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9976 v17 = (signed int)v3->ptr_48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9977 v18 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9978 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9980 if ( v17 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9982 v19 = (unsigned __int16 *)v18->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9984 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9986 if ( v17 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9987 v19 = (unsigned __int16 *)v18->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9988 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9989 v19 = (unsigned __int16 *)v18->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9990 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9991 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9992 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9993 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9994 v19 = (unsigned __int16 *)v18->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9995 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9996 a1.pTextureLOD = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9997 X = (unsigned __int64)(v36 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9998 v20 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9999 X = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10000 a1.field_30 = v28 + ((unsigned __int64)(v36 * (signed __int64)v38) >> 16) - v20->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10001 X = (unsigned __int64)(v34 * (signed __int64)v38) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10002 v21 = X - v3->ptr_38->field_28 - v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10003 a1.field_30 >>= v17 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10004 a1.field_2C = v21 >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10005 v35 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10006 v37 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v38) >> 16) >> (v17 + bUseLoResSprites);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10007 a1.field_4 = (unsigned __int64)(v37 * (signed __int64)v29) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10008 X = (unsigned __int64)(v37 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10009 a1.field_0 = -(signed int)((unsigned __int64)(v37 * (signed __int64)v32) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10010 v22 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10011 a1.pColorBuffer = &pRenderer->pTargetSurface[v2->field_8 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10012 HIWORD(v23) = HIWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10013 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v2->field_8 + 640 * v22];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10014 LOWORD(v23) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10015 a1.field_24 = v23 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10016 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10017 v32 = (signed int)v24->uTextureWidth >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10018 v25 = (signed int)v24->uTextureHeight >> v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10019 a1.field_10 = v17 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10020 a1.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10021 a1.field_8 = (v25 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10022 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
10023 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10024 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10025 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10026 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10027 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10028 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10029
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10030 //----- (00482E07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10031 signed int __fastcall sr_sub_482E07(Span *ecx0, unsigned __int16 *pRenderTarget)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10033 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10034 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10035 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10036 int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10037 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10038 stru149 *v7; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10039 int v8; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10040 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10041 int v10; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10042 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10043 unsigned __int64 v12; // qax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10044 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10045 signed __int64 v14; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10046 int v15; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10047 signed __int64 v16; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10048 int v17; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10049 unsigned __int16 *v18; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10050 Texture *v19; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10051 Texture *v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10052 Texture *v21; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10053 Texture *v22; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10054 int v23; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10055 Texture *v24; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10056 signed int v25; // edx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10057 signed int v26; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10058 char v27; // bl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10059 stru149 *v28; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10060 stru149 *v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10061 int v30; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10062 int v31; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10063 unsigned int v32; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10064 int v33; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10065 signed __int64 v34; // qtt@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10066 signed int v35; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10067 int v36; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10068 stru149 *v37; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10069 int v38; // edi@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10070 int v39; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10071 int v40; // edi@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10072 signed __int64 v41; // qtt@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10073 int v42; // edx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10074 stru149 *v43; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10075 int v44; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10076 int v45; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10077 Span *v46; // edi@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10078 stru149 *v47; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10079 stru149 *v48; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10080 int v49; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10081 int v50; // ecx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10082 unsigned int v51; // edx@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10083 int v52; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10084 signed __int64 v53; // qtt@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10085 unsigned int v54; // ecx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10086 int v55; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10087 stru149 *v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10088 int v57; // edi@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10089 int v58; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10090 int v59; // edi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10091 signed __int64 v60; // qtt@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10092 int v61; // edx@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10093 stru149 *v62; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10094 int v63; // edi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10095 int v64; // eax@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10096 int v66; // [sp+Ch] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10097 int v67; // [sp+10h] [bp-B4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10098 int v68; // [sp+14h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10099 int v69; // [sp+18h] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10100 int v70; // [sp+1Ch] [bp-A8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10101 int v71; // [sp+20h] [bp-A4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10102 signed int v72; // [sp+24h] [bp-A0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10103 stru316 a2; // [sp+28h] [bp-9Ch]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10104 int v74; // [sp+50h] [bp-74h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10105 stru315 a1; // [sp+54h] [bp-70h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10106 Span *v76; // [sp+98h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10107 unsigned __int16 *v77; // [sp+9Ch] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10108 int v78; // [sp+A0h] [bp-24h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10109 int v79; // [sp+A4h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10110 int v80; // [sp+A8h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10111 int v81; // [sp+ACh] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10112 int X; // [sp+B0h] [bp-14h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10113 int v83; // [sp+B4h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10114 int v84; // [sp+B8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10115 int v85; // [sp+BCh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10116 int v86; // [sp+C0h] [bp-4h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10118 v85 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10119 v3 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10120 v4 = pViewport->uScreenCenterY - ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10121 v77 = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10122 v5 = pOutdoorCamera->int_fov_rad_inv * v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10123 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10124 v76 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10125 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10126 v83 = v6->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10127 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10128 v7 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10129 v8 = v81 + v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10130 v83 = v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10131 v67 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10132 v9 = ((unsigned __int64)(v83 * (signed __int64)v5) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10133 v81 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10134 v71 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10135 v83 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10136 v81 = (unsigned __int64)(v83 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10137 v68 = v3->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10138 v69 = v3->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10139 v72 = -v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10140 v10 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - ecx0->field_8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10141 v11 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10142 v66 = v81 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10143 v83 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10144 v12 = v10 * (signed __int64)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10145 v81 = v12 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10146 v13 = v66 + (v12 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10147 v84 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10148 if ( !v13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10149 || (X = v72 >> 15, v83 = abs(v13), abs(v72 >> 15) >= v83)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10150 || (LODWORD(v14) = v72 << 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10151 HIDWORD(v14) = v72 >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10152 v79 = v14 / v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10153 v80 = v10 - v85 * pOutdoorCamera->int_fov_rad_inv,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10154 v81 = (unsigned __int64)(v80 * (signed __int64)v3->v_18.y) >> 16,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10155 (v84 = v66 + v81) == 0)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10156 || (v15 = abs(v66 + v81), abs(X) >= v15) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10157 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10158 LODWORD(v16) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10159 HIDWORD(v16) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10160 v70 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10161 v17 = v16 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10162 a1.field_24 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10163 if ( v79 >= v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10164 a1.field_24 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10165 v18 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10166 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10167 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10168 if ( a1.field_24 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10170 if ( a1.field_24 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10171 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10172 if ( a1.field_24 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10174 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10175 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10176 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10177 v84 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10178 v18 = (unsigned __int16 *)v22->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10180 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10181 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10182 v21 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10183 v84 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10184 v18 = (unsigned __int16 *)v21->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10186 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10187 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10189 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10190 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10191 v18 = (unsigned __int16 *)v20->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10192 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10193 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10194 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10196 v19 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10197 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10198 v18 = (unsigned __int16 *)v19->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10200 a1.pTextureLOD = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10201 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10202 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10204 v23 = v3->field_5A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10205 v83 = v3->field_52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10206 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10207 v74 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10208 v78 = v85 >> v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10209 v25 = v24->uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10210 v81 = v85 - (v85 >> v23 << v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10211 v26 = (signed int)v24->uTextureHeight >> v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10212 a1.field_10 = v84 - v24->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10213 v27 = v84 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10214 a1.field_8 = (v26 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10215 a1.field_C = (v25 >> v84) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10216 if ( v79 >= v70 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10218 v46 = v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10219 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
10220 v47 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10221 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10222 v86 = v47->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10223 v79 = v80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10224 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10225 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10226 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10227 v79 = (unsigned __int64)(v84 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10228 v48 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10229 v79 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10230 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v70) >> 16) - v48->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10231 v79 = (unsigned __int64)(v86 * (signed __int64)v70) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10232 v49 = ((unsigned __int64)(v86 * (signed __int64)v70) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10233 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10234 a1.field_2C = (v69 + v49) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10235 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10236 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10237 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10238 v50 = v46->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10239 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10240 v51 = v50 + pRenderer->uTargetSurfacePitch * v46->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10241 a1.pDepthBuffer = (unsigned int *)(&pRenderer->pActiveZBuffer[640 * v46->field_A - 1] + v85 + v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10242 a1.pColorBuffer = &v77[v85 - 1] + v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10243 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10244 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10245 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10246 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10247 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10248 v77 = (unsigned __int16 *)v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10249 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10250 v84 = v66 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10251 if ( v66 + (unsigned int)((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10252 && (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
10253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10254 LODWORD(v53) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10255 HIDWORD(v53) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10256 v86 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10257 v54 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10258 v84 = v53 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10259 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10260 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10262 v84 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10263 v54 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10265 HIWORD(v55) = HIWORD(v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10266 LOWORD(v55) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10267 a1.field_24 = v3->field_50 | v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10268 v77 = (unsigned __int16 *)v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10269 v77 = (unsigned __int16 *)(v67 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10270 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10271 v56 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10272 v57 = ((unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16) - v56->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10273 v77 = (unsigned __int16 *)v56->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10274 v77 = (unsigned __int16 *)(v71 + ((unsigned __int64)((signed int)v77 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10275 v86 = (unsigned __int64)((signed int)v77 * (signed __int64)(signed int)v54) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10276 v58 = (((v69 + v86 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10277 a1.field_4 = (((v68 + v57) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10278 a1.field_0 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10279 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10280 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10282 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10283 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10284 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10285 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10287 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10288 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10289 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10290 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10291 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10292 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10293 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10294 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10295 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10296 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10297 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10298 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10299 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10300 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10301 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10302 v80 += pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10303 --v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10305 while ( v78 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10307 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10308 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10309 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10310 v86 = (unsigned __int64)(v83 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10311 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10312 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10314 v59 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10315 if ( abs(X) < v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10317 LODWORD(v60) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10318 HIDWORD(v60) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10319 v86 = v60 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10320 HIWORD(v61) = (unsigned int)(v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10321 LOWORD(v61) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10322 a1.field_24 = v61 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10323 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10324 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10325 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10326 v62 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10327 v63 = ((unsigned __int64)(v83 * v60 / v84) >> 16) - v62->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10328 v83 = v62->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10329 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10330 v86 = (unsigned __int64)(v83 * v60 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10331 v64 = (((signed int)(v69 + ((unsigned __int64)(v83 * v60 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10332 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10333 a1.field_4 = (((v68 + v63) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10334 a1.field_0 = v64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10335 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10336 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10337 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10338 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10339 sr_sub_485BAE(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10340 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10341 sr_sub_485AFF(&a1, &a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10343 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10345 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10346 sr_sub_4D71F8(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10347 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10348 sr_sub_4D714C(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10349 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10350 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10354 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10355 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10356 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
10357 v28 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10358 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10359 v86 = v28->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10360 v85 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10361 v84 = v67 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10362 v86 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10363 v86 = v71 + ((unsigned __int64)(v86 * (signed __int64)v10) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10364 v85 = (unsigned __int64)(v84 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10365 v29 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10366 v85 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10367 a1.field_30 = v68 + ((unsigned __int64)(v84 * (signed __int64)v79) >> 16) - v29->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10368 v85 = (unsigned __int64)(v86 * (signed __int64)v79) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10369 v30 = ((unsigned __int64)(v86 * (signed __int64)v79) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10370 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10371 a1.field_2C = (v69 + v30) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10372 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10373 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10374 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10375 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10376 v31 = v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10377 v32 = pRenderer->uTargetSurfacePitch * v76->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10378 v86 = v76->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10379 a1.pColorBuffer = &v77[v86 + v32];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10380 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v86 + 640 * v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10381 v80 = v10 - (pOutdoorCamera->int_fov_rad_inv << v74);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10382 if ( v78 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10384 v86 = v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10385 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10387 v78 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10388 v85 = (unsigned __int64)(v78 * (signed __int64)v80) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10389 v84 = v66 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10390 if ( v66 + (unsigned int)((unsigned __int64)(v78 * (signed __int64)v80) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10391 && (v33 = abs((signed __int64)v66 + ((__int64)(v78 * (signed __int64)v80) >> 16)), abs((signed __int64)X) < v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10393 LODWORD(v34) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10394 HIDWORD(v34) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10395 v85 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10396 v35 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10397 v84 = v34 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10399 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10401 v84 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10402 v35 = 1073741824;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10404 HIWORD(v36) = HIWORD(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10405 LOWORD(v36) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10406 a1.field_24 = v3->field_50 | v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10407 v78 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10408 v78 = v67 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10409 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10410 v37 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10411 v38 = ((unsigned __int64)(v78 * (signed __int64)v35) >> 16) - v37->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10412 v78 = v37->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10413 v78 = v71 + ((unsigned __int64)(v78 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10414 v85 = (unsigned __int64)(v78 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10415 v39 = (((v69 + v85 - v3->ptr_38->field_28) >> v27) - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10416 a1.field_4 = (((v68 + v38) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10417 a1.field_0 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10418 a1.field_28 = v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10419 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10421 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10422 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10423 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10424 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10426 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10428 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10429 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10430 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10431 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10433 a1.field_34_palette = (unsigned __int16 *)sr_sub_485E1F(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10434 &a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10435 v76,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10436 v84,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10437 v3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10438 pOutdoorCamera->building_gamme,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10439 1u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10440 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10441 v80 -= pOutdoorCamera->int_fov_rad_inv << v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10442 --v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10443 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10444 while ( v86 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10446 if ( !v81 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10447 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10448 v83 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10449 v76 = (Span *)((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10450 v84 = v66 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10451 if ( v66 + (unsigned int)((unsigned __int64)(v83 * (signed __int64)v80) >> 16) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10452 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10453 v40 = abs((signed __int64)v66 + ((__int64)(v83 * (signed __int64)v80) >> 16));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10454 if ( abs(X) < v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10456 LODWORD(v41) = v72 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10457 HIDWORD(v41) = v72 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10458 X = v41 / v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10459 HIWORD(v42) = (unsigned int)(v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10460 LOWORD(v42) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10461 a1.field_24 = v42 | v3->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10462 v83 = v3->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10463 v83 = v67 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10464 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10465 v43 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10466 v44 = ((unsigned __int64)(v83 * v41 / v84) >> 16) - v43->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10467 v83 = v43->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10468 v83 = v71 + ((unsigned __int64)(v83 * (signed __int64)v80) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10469 X = (unsigned __int64)(v83 * v41 / v84) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10470 v45 = (((signed int)(v69 + ((unsigned __int64)(v83 * v41 / v84) >> 16) - v3->ptr_38->field_28) >> v27)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10471 - a1.field_2C) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10472 a1.field_4 = (((v68 + v44) >> v27) - a1.field_30) >> v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10473 a1.field_0 = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10474 a1.field_28 = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10475 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10477 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10478 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10479 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10480 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10482 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10483 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10484 if ( v3->pODMFace->uPolygonType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10485 sr_sub_4D705A(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10486 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10487 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10488 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10489 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10490 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10492 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10493 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10494 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10495 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10496 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10497 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10498 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10499 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10500 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10501 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10502 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10503 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10504
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10505 //----- (004839BD) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10506 signed int __fastcall sr_sub_4839BD(Span *ecx0, unsigned __int16 *pTargetSurface)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10507 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10508 stru315 *v2; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10509 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10510 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10511 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10512 unsigned int v6; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10513 int v7; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10514 int v8; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10515 int v9; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10516 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10517 stru149 *v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10518 int v12; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10519 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10520 int v14; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10521 int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10522 int v16; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10523 signed int v17; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10524 int v18; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10525 signed __int64 v19; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10526 int v20; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10527 unsigned __int16 *v21; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10528 Texture *v22; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10529 Texture *v23; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10530 Texture *v24; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10531 Texture *v25; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10532 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10533 int v27; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10534 signed int v28; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10535 Texture *v29; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10536 int v30; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10537 signed int v31; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10538 signed int v32; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10539 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10540 int v34; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10541 int v35; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10542 int v36; // ebx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10543 int v37; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10544 signed __int64 v38; // qtt@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10545 int v39; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10546 int v40; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10547 stru149 *v41; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10548 int v42; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10549 int v43; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10550 int v44; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10551 char v45; // zf@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10552 int v46; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10553 int v47; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10554 int v48; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10555 int v49; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10556 signed __int64 v50; // qtt@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10557 int v51; // ecx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10558 int v52; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10559 int v53; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10560 stru149 *v54; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10561 int v55; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10562 signed int v56; // ebx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10563 int v57; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10564 unsigned __int64 v58; // qax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10565 int v60; // [sp+Ch] [bp-BCh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10566 Span *v61; // [sp+10h] [bp-B8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10567 int v62; // [sp+14h] [bp-B4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10568 int v63; // [sp+18h] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10569 stru315 a1; // [sp+1Ch] [bp-ACh]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10570 stru316 a2; // [sp+60h] [bp-68h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10571 int v66; // [sp+88h] [bp-40h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10572 int v67; // [sp+8Ch] [bp-3Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10573 int v68; // [sp+90h] [bp-38h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10574 int v69; // [sp+94h] [bp-34h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10575 int v70; // [sp+98h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10576 int v71; // [sp+9Ch] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10577 int v72; // [sp+A0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10578 int v73; // [sp+A4h] [bp-24h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10579 int v74; // [sp+A8h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10580 int v75; // [sp+ACh] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10581 int v76; // [sp+B0h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10582 int v77; // [sp+B4h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10583 int X; // [sp+B8h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10584 int v79; // [sp+BCh] [bp-Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10585 int v80; // [sp+C0h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10586 unsigned int v81; // [sp+C4h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10587
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10588 v3 = ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10589 v4 = ecx0->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10590 v5 = ecx0->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10591 v6 = v4 + pRenderer->uTargetSurfacePitch * ecx0->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10592 v61 = ecx0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10593 v7 = ecx0->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10594 a1.pColorBuffer = &pTargetSurface[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10595 v74 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10596 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v4 + 640 * v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10597 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10598 v9 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10599 v10 = v5->ptr_38->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10600 v76 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10601 v72 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10602 v81 = (unsigned __int64)(v10 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10603 v11 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10604 v12 = v81 + v11->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10605 v72 = v11->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10606 v67 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10607 v13 = ((unsigned __int64)(v72 * (signed __int64)v9) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10608 v81 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10609 v70 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10610 v72 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10611 v81 = (unsigned __int64)(v72 * (signed __int64)v9) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10612 v14 = v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10613 v15 = v81 + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10614 v71 = v5->sTextureDeltaU << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10615 v63 = v5->sTextureDeltaV << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10616 v16 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10617 v17 = -v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10618 v60 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10619 v77 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10620 v81 = (unsigned __int64)(v76 * (signed __int64)v16) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10621 X = v81 + v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10622 if ( !(v81 + v15) || (v62 = v17 >> 14, v18 = abs(v17 >> 14), v18 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10623 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10624 LODWORD(v19) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10625 HIDWORD(v19) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10626 v69 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10627 v20 = v19 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10628 v21 = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10629 a1.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10630 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10631 if ( v20 >= mipmapping_building_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10633 if ( v20 >= mipmapping_building_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10635 if ( v20 >= mipmapping_building_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10637 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10638 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10639 v25 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10640 v75 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10641 v21 = (unsigned __int16 *)v25->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10643 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10645 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10646 v75 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10647 v21 = (unsigned __int16 *)v24->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10650 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10652 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10653 v75 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10654 v21 = (unsigned __int16 *)v23->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10655 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10657 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10659 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10660 v75 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10661 v21 = (unsigned __int16 *)v22->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10662 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10663 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10664 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10665 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10667 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
10668 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10669 v66 = v74 >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10670 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10671 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10672 v72 = v74 - 16 * (v74 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10673 v76 = v26->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10674 v81 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10675 v74 = v67 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10676 v76 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10677 v76 = v70 + ((unsigned __int64)(v76 * (signed __int64)v8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10678 v81 = (unsigned __int64)(v74 * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10679 v27 = ((unsigned __int64)(v74 * (signed __int64)v20) >> 16) - v5->ptr_38->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10680 v81 = (unsigned __int64)(v76 * (signed __int64)v69) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10681 v28 = v63 + ((unsigned __int64)(v76 * (signed __int64)v69) >> 16) - v5->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10682 v76 = v75 + bUseLoResSprites;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10683 v73 = v8 - 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10684 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10685 v30 = (v71 + v27) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10686 v31 = v28 >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10687 v32 = (signed int)v29->uTextureWidth >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10688 v74 = (signed __int16)v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10689 v68 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10690 v80 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10691 v33 = (signed int)v29->uTextureHeight >> v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10692 v34 = v75 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10693 a1.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10694 v81 = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10695 a1.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10696 a1.field_C = v80 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10697 if ( v66 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10698 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10699 v74 = v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10700 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10701 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10703 v80 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10704 v35 = (unsigned __int64)(v80 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10705 v36 = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10706 X = v35 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10707 if ( v35 + v60 && (v80 = abs(v62), v37 = abs(v36), v80 <= v37) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10709 LODWORD(v38) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10710 HIDWORD(v38) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10711 v80 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10712 v39 = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10713 X = v38 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10714 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10715 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10716 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10717 X = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10718 v39 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10720 HIWORD(v40) = HIWORD(v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10721 if ( v39 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10722 HIWORD(v40) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10723 LOWORD(v40) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10724 a1.field_24 = v5->field_50 | v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10725 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10726 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10727 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10728 v41 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10729 v42 = ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v41->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10730 v79 = v41->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10731 v79 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10732 v80 = (unsigned __int64)(v79 * (signed __int64)v39) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10733 v43 = (v71 + v42) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10734 v79 = (signed int)(v63 + ((unsigned __int64)(v79 * (signed __int64)v39) >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10735 a1.field_4 = (v43 - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10736 a1.field_0 = (v79 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10737 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v68 >> v66));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10738 v44 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10739 a1.field_2C = v68 + 4 * v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10740 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10741 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10742 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10743 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10744 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
10745 v73 -= 16 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10746 v45 = v74-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10747 a1.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10748 v30 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10749 v68 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10750 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10751 while ( !v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10752 v31 = v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10754 if ( !v72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10755 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10756 v66 = 12 - v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10757 a1.field_30 = v30 + 4 * stru_5C6E00->SinCos(v81 + (v31 >> (12 - v75)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10758 v46 = stru_5C6E00->SinCos(v81 + (v30 >> v66) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10759 a1.field_2C = v68 + 4 * v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10760 v79 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10761 v80 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10762 v47 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10763 v48 = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10764 X = v47 + v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10765 if ( v47 + v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10767 v79 = abs(v62);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10768 v49 = abs(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10769 if ( v79 <= v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10770 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10771 LODWORD(v50) = v77 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10772 HIDWORD(v50) = v77 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10773 v77 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10774 v51 = v50 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10775 HIWORD(v52) = HIWORD(v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10776 if ( v51 <= v69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10778 LOWORD(v52) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10779 a1.field_24 = v52 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10780 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10781 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10782 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10783 HIWORD(v53) = HIWORD(v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10784 LOWORD(v53) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10785 a1.field_24 = v53 | v5->field_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10787 v79 = v5->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10788 v77 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10789 v79 = v67 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10790 v67 = (unsigned __int64)(v79 * (signed __int64)v51) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10791 v54 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10792 v55 = v67 - v54->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10793 v79 = v54->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10794 v56 = v71 + v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10795 v71 = (unsigned __int64)(v79 * (signed __int64)v73) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10796 v57 = v70 + ((unsigned __int64)(v79 * (signed __int64)v73) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10797 v79 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10798 v58 = v57 * (signed __int64)v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10799 v70 = v58 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10800 LODWORD(v58) = (signed int)(v63 + (v58 >> 16) - v5->ptr_38->field_28) >> v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10801 a1.field_4 = ((v56 >> v76) - v30) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10802 a1.field_0 = ((signed int)v58 - v68) >> 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10803 a1.field_28 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10804 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10805 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10806 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10807 sr_sub_4D6FB0(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10808 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10810 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10812 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10814 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10815 // 6BE0E4: using guessed type int mipmapping_building_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10816 // 6BE0E8: using guessed type int mipmapping_building_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10817 // 6BE0EC: using guessed type int mipmapping_building_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10818
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10819
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10820
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10821 //----- (0048408A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10822 signed int sr_sub_48408A_prolly_odm_water_no_waves(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10824 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10825 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10826 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10827 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10828 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10829 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10830 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10831 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10832 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10833 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10834 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10835 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10836 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10837 int v14; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10838 signed int v15; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10839 int v16; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10840 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10841 stru149 *v18; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10842 int v19; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10843 Texture *v20; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10844 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10845 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10846 Texture *v23; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10847 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10848 stru149 *v25; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10849 signed int v26; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10850 int v27; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10851 int v28; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10852 int v29; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10853 int v30; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10854 Texture *v31; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10855 int v32; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10856 int v33; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10857 int v35; // [sp+Ch] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10858 int v36; // [sp+10h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10859 stru316 a2; // [sp+14h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10860 stru315 a1; // [sp+3Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10861 int v39; // [sp+80h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10862 int v40; // [sp+84h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10863 int v41; // [sp+88h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10864 int v42; // [sp+8Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10865 int v43; // [sp+90h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10866 int v44; // [sp+94h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10868 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10869 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10870 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10871 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10872 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10873 v42 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10874 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10875 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10876 v7 = v44 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10877 v42 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10878 v39 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10879 v8 = ((unsigned __int64)(v42 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10880 v44 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10881 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10882 v42 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10883 v44 = (unsigned __int64)(v42 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10884 v9 = v44 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10885 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10886 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10887 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10888 v36 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10889 a1.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10890 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10891 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10892 v42 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10893 v14 = v3->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10894 v15 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10895 v40 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10896 v16 = ((unsigned __int64)(v42 * (signed __int64)v14) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10897 v44 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10898 if ( !v16 || (v43 = abs(v15 >> 14), v43 > abs(v16)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10899 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10900 LODWORD(v17) = v40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10901 HIDWORD(v17) = v40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10902 v43 = v17 / v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10903 v18 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10904 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10905 v40 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10906 v44 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10907 v40 = v39 + ((unsigned __int64)(v40 * (signed __int64)v42) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10908 v39 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10909 v44 = (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10910 v19 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10911 v41 += (unsigned __int64)(v39 * (signed __int64)v42) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10912 a1.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10913 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10914 if ( v43 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10915 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10916 v20 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10917 v44 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10918 v21 = (unsigned __int16 *)v20->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10919 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10920 a1.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10921 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10922 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10923 if ( v43 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10924 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10925 v22 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10926 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10927 v21 = (unsigned __int16 *)v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10928 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10930 if ( v43 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10931 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10932 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10934 v24 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10935 v44 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10936 v21 = (unsigned __int16 *)v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10937 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10939 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10940 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10941 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10942 v23 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10943 v44 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10944 a1.pTextureLOD = (unsigned __int16 *)v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10945 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10946 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10947 v43 = (unsigned __int64)(v40 * (signed __int64)v43) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10948 v25 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10949 v43 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10950 a1.field_30 = ((unsigned __int64)(v40 * (signed __int64)v19) >> 16) - v25->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10951 v43 = (unsigned __int64)(v41 * (signed __int64)v19) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10952 v26 = ((unsigned __int64)(v41 * (signed __int64)v19) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10953 v27 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10954 a1.field_30 >>= v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10955 v41 = bUseLoResSprites + v44 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10956 a1.field_2C = v26 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10957 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10959 a1.field_14 = dword_80AA20 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10960 a1.field_18 = dword_80AA1C >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10961 a1.field_1C = dword_80AA18 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10962 a1.field_20 = dword_80AA14 >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10964 v41 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10965 v42 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v19) >> 16) >> v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10966 a1.field_4 = (unsigned __int64)(v42 * (signed __int64)v35) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10967 v43 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10968 a1.field_0 = (unsigned __int64)(v42 * (signed __int64)v36) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10969 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
10970 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10971 v28 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10972 v29 = v2->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10973 a1.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10974 v30 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10975 a1.pColorBuffer = &pRenderer->pTargetSurface[v30 + pRenderer->uTargetSurfacePitch * v29];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10976 a1.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v30 + 640 * v28];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10977 v31 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10978 v32 = ((signed int)v31->uTextureWidth >> v44) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10979 v33 = ((signed int)v31->uTextureHeight >> v44 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10980 a1.field_10 = v44 - v31->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10981 a1.field_C = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10982 a1.field_8 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10983 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10985 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10986 sr_sub_485A24(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10987 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10988 sr_sub_485975(&a1, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10990 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10991 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10992 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10993 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10994 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10995 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10997 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10999
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11001
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11002 //----- (00484442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11003 signed int sr_sub_484442(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11005 int v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11006 Span *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11007 stru148 *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11008 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11009 stru149 *v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11010 stru149 *v6; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11011 int v7; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11012 int v8; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11013 int v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11014 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11015 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11016 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11017 int v13; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11018 signed int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11019 int v15; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11020 signed __int64 v16; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11021 int v17; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11022 int v18; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11023 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11024 signed int v20; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11025 unsigned __int16 *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11026 stru149 *v22; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11027 signed int v23; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11028 int v24; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11029 int v25; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11030 unsigned int *v26; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11031 Texture *v27; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11032 signed int v28; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11033 signed int v29; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11034 signed int v31; // [sp+Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11035 int v32; // [sp+10h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11036 int v33; // [sp+14h] [bp-88h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11037 stru316 v34; // [sp+18h] [bp-84h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11038 stru315 v35; // [sp+40h] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11039 int v36; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11040 int v37; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11041 int v38; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11042 int v39; // [sp+90h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11043 int v40; // [sp+94h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11044 int v41; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11045
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11046 v2 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11047 v3 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11048 v4 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - _this->field_A);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11049 v5 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11050 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11051 v39 = v5->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11052 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11053 v6 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11054 v7 = v40 + v6->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11055 v39 = v6->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11056 v36 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11057 v8 = ((unsigned __int64)(v39 * (signed __int64)v4) >> 16) + v3->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11058 v40 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11059 v38 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11060 v39 = v3->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11061 v40 = (unsigned __int64)(v39 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11062 v9 = v40 + v3->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11063 v32 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11064 v10 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11065 v11 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11066 v33 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11067 v35.field_28 = v2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11068 v12 = pViewport->uScreenCenterX - v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11069 v13 = v3->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11070 v41 = pOutdoorCamera->int_fov_rad_inv * v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11071 v14 = -v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11072 v31 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11073 v15 = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * v12 * (signed __int64)v3->v_18.y) >> 16) + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11074 v37 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11075 if ( !v15 || (v39 = abs(v14 >> 14), v39 > abs(v15)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11076 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11077 LODWORD(v16) = v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11078 HIDWORD(v16) = v31 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11079 v40 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11080 v17 = v16 / v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11081 v18 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11082 HIWORD(v19) = (unsigned int)(v16 / v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11083 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11084 v35.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11085 v37 = v36 + ((unsigned __int64)(v3->ptr_38->field_10 * (signed __int64)v41) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11086 v36 = v3->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11087 v41 = (unsigned __int64)(v36 * (signed __int64)v41) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11088 v38 += (unsigned __int64)(v36 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11089 v20 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11090 v35.pTextureLOD = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11091 if ( v17 < mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11093 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11094 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11095 LABEL_11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11096 v35.pTextureLOD = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11097 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11099 if ( v17 < mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11101 v20 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11102 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11103 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11105 if ( v17 < mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11107 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11108 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11110 if ( !bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11112 v20 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11113 v21 = (unsigned __int16 *)v3->pTexture->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11114 goto LABEL_11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11116 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11117 v41 = (unsigned __int64)(v37 * (signed __int64)v17) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11118 v22 = v3->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11119 v41 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11120 v35.field_30 = ((unsigned __int64)(v37 * (signed __int64)v17) >> 16) - v22->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11121 v23 = ((unsigned __int64)(v38 * (signed __int64)v17) >> 16) - v3->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11122 v24 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11123 v35.field_30 >>= v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11124 v38 = bUseLoResSprites + v20 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11125 v35.field_2C = v23 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11126 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11128 v35.field_14 = dword_80AA20 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11129 v35.field_18 = dword_80AA1C >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11130 v35.field_1C = dword_80AA18 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11131 v35.field_20 = dword_80AA14 >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11132 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11133 v38 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11134 v39 = (signed int)((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)v40) >> 16) >> v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11135 v35.field_4 = (unsigned __int64)(v39 * (signed __int64)v32) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11136 v41 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11137 v35.field_0 = (unsigned __int64)(v39 * (signed __int64)v33) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11138 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
11139 v25 = v2->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11140 v26 = (unsigned int *)&pRenderer->pActiveZBuffer[v25 + 640 * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11141 v35.pColorBuffer = &pRenderer->pTargetSurface[v25 + pRenderer->uTargetSurfacePitch * v2->field_A];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11142 v35.pDepthBuffer = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11143 v27 = v3->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11144 v28 = (signed int)v27->uTextureWidth >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11145 v29 = (signed int)v27->uTextureHeight >> v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11146 v35.field_10 = v20 - v27->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11147 v35.field_C = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11148 v35.field_8 = (v29 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11149 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11151 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11152 sr_sub_485D3E(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11153 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11154 sr_sub_485C89(&v35, &v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11156 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11158 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11159 sr_sub_4D72EC(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11160 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11161 sr_sub_4D73DF(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11162 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11163 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11164 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11165
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11167 //----- (004847EB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11168 int sr_sub_4847EB(Span *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11169 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11170 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11171 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11172 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11173 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11174 int v5; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11175 signed int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11176 int v7; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11177 stru149 *v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11178 stru149 *v9; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11179 int v10; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11180 int v11; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11181 signed int v12; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11182 int v13; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11183 signed __int64 v14; // qtt@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11184 int v15; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11185 signed int v16; // ebx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11186 unsigned __int16 *v17; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11187 stru149 *v18; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11188 stru149 *v19; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11189 signed int v20; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11190 int v21; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11191 Texture *v22; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11192 signed int v23; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11193 int v24; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11194 int v25; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11195 int v26; // ebx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11196 int v27; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11197 int v28; // edi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11198 int v29; // eax@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11199 signed __int64 v30; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11200 int v31; // ecx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11201 int v32; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11202 stru149 *v33; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11203 signed int v34; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11204 int v35; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11205 signed int v36; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11206 signed __int64 v37; // qtt@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11207 signed int v38; // ebx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11208 int v39; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11209 int v40; // eax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11210 unsigned __int64 v41; // qax@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11211 int v42; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11212 int v43; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11213 signed __int64 v44; // qtt@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11214 int v45; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11215 int v46; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11216 stru149 *v47; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11217 signed int v48; // edi@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11218 int v49; // eax@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11219 int v50; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11220 unsigned __int64 v51; // qax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11221 int v52; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11222 int v53; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11223 signed __int64 v54; // qtt@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11224 int v55; // ecx@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11225 int v56; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11226 stru149 *v57; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11227 signed int v58; // edi@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11228 int v59; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11229 Span *v61; // [sp+Ch] [bp-B0h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11230 int v62; // [sp+10h] [bp-ACh]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11231 int v63; // [sp+14h] [bp-A8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11232 int v64; // [sp+18h] [bp-A4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11233 int v65; // [sp+1Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11234 signed int v66; // [sp+20h] [bp-9Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11235 signed int v67; // [sp+24h] [bp-98h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11236 int v68; // [sp+28h] [bp-94h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11237 char v69; // [sp+2Ch] [bp-90h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11238 stru315 sr; // [sp+30h] [bp-8Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11239 stru316 sr2; // [sp+74h] [bp-48h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11240 int v72; // [sp+9Ch] [bp-20h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11241 int v73; // [sp+A0h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11242 int v74; // [sp+A4h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11243 int v75; // [sp+A8h] [bp-14h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11244 int v76; // [sp+ACh] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11245 int v77; // [sp+B0h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11246 int v78; // [sp+B4h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11247 int v79; // [sp+B8h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11249 v2 = _this->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11250 v3 = _this->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11251 v4 = _this->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11252 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11253 v61 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11254 sr.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11255 v76 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11256 v5 = _this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11257 sr.pColorBuffer = &pRenderer->pTargetSurface[v3 + pRenderer->uTargetSurfacePitch * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11258 v68 = texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11259 v69 = texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11260 if ( v5 >= texmapping_terrain_subdivsize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11261 v73 = texmapping_terrain_subdivsize - (v3 & (texmapping_terrain_subdivsize - 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11262 v6 = v5 - v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11263 v67 = v6 >> texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11264 v62 = v6 - (v6 >> texmapping_terrain_subdivpow2 << texmapping_terrain_subdivpow2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11265 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11266 v8 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11267 v79 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11268 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11269 v76 = v8->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11270 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11271 v9 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11272 v10 = v78 + v9->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11273 v76 = v9->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11274 v65 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11275 v11 = ((unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11276 + v4->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11277 v78 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11278 v64 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11279 v76 = v4->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11280 v78 = (unsigned __int64)(v76 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2))) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11281 v12 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11282 v63 = v78 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11283 v66 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11284 v78 = (unsigned __int64)(v79 * (signed __int64)v4->v_18.y) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11285 v74 = v78 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11286 if ( !(v78 + v63) || (v76 = v12 >> 14, v13 = abs(v12 >> 14), v13 > abs(v74)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11287 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11288 LODWORD(v14) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11289 HIDWORD(v14) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11290 v72 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11291 sr.pTextureLOD = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11292 v15 = v14 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11293 v16 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11294 if ( v15 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11296 if ( v15 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11297 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11298 if ( v15 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11299 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11300 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11301 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11302 v16 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11303 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11304 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11305 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11307 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11309 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11310 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11311 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11312 v16 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11313 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11315 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11316 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11318 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11319 v17 = (unsigned __int16 *)v4->pTexture->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11321 sr.pTextureLOD = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11322 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11323 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
11324 v18 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11325 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11326 v79 = v18->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11327 v78 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11328 v77 = v65 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11329 v79 = v4->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11330 v79 = v64 + ((unsigned __int64)(v79 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11331 v78 = (unsigned __int64)(v77 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11332 v19 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11333 v78 = v72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11334 sr.field_30 = ((unsigned __int64)(v77 * (signed __int64)v72) >> 16) - v19->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11335 v78 = (unsigned __int64)(v79 * (signed __int64)v72) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11336 v20 = ((unsigned __int64)(v79 * (signed __int64)v72) >> 16) - v4->ptr_38->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11337 v21 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11338 sr.field_30 >>= v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11339 v78 = bUseLoResSprites + v16 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11340 sr.field_2C = v20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11341 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11343 sr.field_14 = dword_80AA20 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11344 sr.field_18 = dword_80AA1C >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11345 sr.field_1C = dword_80AA18 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11346 sr.field_20 = dword_80AA14 >> v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11348 v22 = v4->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11349 v79 = (signed int)v22->uTextureWidth >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11350 v23 = (signed int)v22->uTextureHeight >> v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11351 v24 = v16 - v22->uWidthLn2 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11352 sr.field_8 = (v23 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11353 sr.field_10 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11354 sr.field_C = v79 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11355 if ( v73 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11357 v25 = v7 - v73 * pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11358 v26 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11359 v77 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11360 v79 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11361 v27 = (unsigned __int64)(v77 * (signed __int64)v25) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11362 v28 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11363 v74 = v27 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11364 if ( !(v27 + v63) || (v77 = abs(v76), v29 = abs(v28), v77 > v29) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11365 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11366 LODWORD(v30) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11367 HIDWORD(v30) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11368 v77 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11369 v31 = v30 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11370 HIWORD(v32) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11371 if ( v72 <= v31 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11372 HIWORD(v32) = HIWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11373 LOWORD(v32) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11374 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11375 sr.field_24 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11376 v74 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11377 v74 = v65 + ((unsigned __int64)(v74 * (signed __int64)v26) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11378 v77 = (unsigned __int64)(v74 * (signed __int64)v31) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11379 v33 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11380 v77 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11381 v34 = ((unsigned __int64)(v74 * (signed __int64)v31) >> 16) - v33->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11382 v74 = v33->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11383 v74 = v64 + ((unsigned __int64)(v74 * (signed __int64)v26) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11384 v77 = (unsigned __int64)(v74 * (signed __int64)v31) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11385 v35 = (v77 - v4->ptr_38->field_28) >> v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11386 v74 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11387 v36 = (v34 >> v78) - sr.field_30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11388 LODWORD(v37) = v36 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11389 HIDWORD(v37) = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11390 v38 = v35 - sr.field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11391 sr.field_4 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11392 v75 = v73 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11393 LODWORD(v37) = v38 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11394 HIDWORD(v37) = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11395 v77 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11396 sr.field_0 = v37 / (v73 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11397 sr.field_28 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11398 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11400 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11401 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11402 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11403 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11405 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11407 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11408 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11409 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11410 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11412 v39 = v79 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11414 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11416 v79 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11417 v39 = v7 - (pOutdoorCamera->int_fov_rad_inv << v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11419 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11420 while ( v67 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11421 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11422 v40 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11423 --v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11424 v75 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11425 v41 = v40 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11426 v79 = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11427 LODWORD(v41) = v41 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11428 v42 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11429 v74 = v41 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11430 if ( !((int)v41 + v63) || (v75 = abs(v76), v43 = abs(v42), v75 > v43) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11431 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11432 LODWORD(v44) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11433 HIDWORD(v44) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11434 v73 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11435 v45 = v44 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11436 HIWORD(v46) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11437 if ( v72 <= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11438 HIWORD(v46) = HIWORD(v45);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11439 LOWORD(v46) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11440 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11441 sr.field_24 = v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11442 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11443 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11444 v79 = (unsigned __int64)(v75 * (signed __int64)v45) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11445 v47 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11446 v79 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11447 v48 = ((unsigned __int64)(v75 * (signed __int64)v45) >> 16) - v47->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11448 v75 = v47->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11449 v75 = v64 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11450 v79 = (unsigned __int64)(v75 * (signed __int64)v45) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11451 v49 = (((v79 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11452 sr.field_4 = ((v48 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11453 sr.field_0 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11454 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11455 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11456 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11457 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11458 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11459 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11461 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11462 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11463 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11464 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11465 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11466 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11468 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
11469 sr.field_28 = v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11470 v39 -= pOutdoorCamera->int_fov_rad_inv << v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11472 if ( !v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11473 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11474 v50 = v4->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11475 v75 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11476 v51 = v50 * (signed __int64)v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11477 v79 = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11478 LODWORD(v51) = v51 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11479 v52 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11480 v74 = v51 + v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11481 if ( (int)v51 + v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11482 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11483 v75 = abs(v76);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11484 v53 = abs(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11485 if ( v75 <= v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11486 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11487 LODWORD(v54) = v66 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11488 HIDWORD(v54) = v66 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11489 v76 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11490 v55 = v54 / v74;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11491 HIWORD(v56) = HIWORD(v72);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11492 if ( v72 <= v55 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11493 HIWORD(v56) = HIWORD(v55);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11494 LOWORD(v56) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11495 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11496 sr.field_24 = v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11497 v75 = v4->ptr_38->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11498 v75 = v65 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11499 v76 = (unsigned __int64)(v75 * (signed __int64)v55) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11500 v57 = v4->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11501 v76 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11502 v58 = ((unsigned __int64)(v75 * (signed __int64)v55) >> 16) - v57->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11503 v75 = v57->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11504 v75 = v64 + ((unsigned __int64)(v75 * (signed __int64)v39) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11505 v76 = (unsigned __int64)(v75 * (signed __int64)v55) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11506 v59 = (((v76 - v4->ptr_38->field_28) >> v78) - sr.field_2C) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11507 sr.field_4 = ((v58 >> v78) - sr.field_30) >> v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11508 sr.field_0 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11509 sr.field_28 = v62;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11510 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11511 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11512 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11513 sr_sub_485A24(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11514 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11515 sr_sub_485975(&sr, (stru315 *)&sr2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11517 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11519 if ( byte_80AA10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11520 sr_sub_4D705A(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11521 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11522 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11524 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11526 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11527 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11529 // 4D864C: using guessed type char byte_4D864C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11530 // 6BE050: using guessed type int texmapping_terrain_subdivsize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11531 // 6BE054: using guessed type int texmapping_terrain_subdivpow2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11532 // 6BE0F0: using guessed type int mipmapping_terrain_mm1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11533 // 6BE0F4: using guessed type int mipmapping_terrain_mm2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11534 // 6BE0F8: using guessed type int mipmapping_terrain_mm3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11535 // 80AA10: using guessed type char byte_80AA10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11536 // 80AA14: using guessed type int dword_80AA14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11537 // 80AA18: using guessed type int dword_80AA18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11538 // 80AA1C: using guessed type int dword_80AA1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11539 // 80AA20: using guessed type int dword_80AA20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11540
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11541
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11542
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11543 //----- (00485407) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11544 signed int __fastcall sr_sub_485407_prolly_odm_water_wavy(Span *a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11546 stru315 *v1; // ebp@0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11547 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11548 int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11549 unsigned int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11550 stru148 *v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11551 int v6; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11552 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11553 int v8; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11554 stru149 *v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11555 stru149 *v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11556 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11557 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11558 int v13; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11559 int v14; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11560 signed int v15; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11561 int v16; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11562 signed __int64 v17; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11563 int v18; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11564 int v19; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11565 unsigned __int8 *pLOD; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11566 Texture *v21; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11567 Texture *v22; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11568 Texture *v23; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11569 Texture *v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11570 stru149 *v25; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11571 stru149 *v26; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11572 signed int v27; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11573 stru149 *v28; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11574 Texture *v29; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11575 signed int v30; // ebx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11576 signed int v31; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11577 signed int v32; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11578 signed int v33; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11579 int v34; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11580 int v35; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11581 unsigned __int64 v36; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11582 int v37; // eax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11583 unsigned __int64 v38; // qax@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11584 char v39; // cl@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11585 stru316 a2; // [sp+Ch] [bp-90h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11586 stru315 a1a; // [sp+34h] [bp-68h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11587 Span *v43; // [sp+78h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11588 int v44; // [sp+7Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11589 int v45; // [sp+80h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11590 int v46; // [sp+84h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11591 Span *v47; // [sp+88h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11592 int v48; // [sp+8Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11593 int v49; // [sp+90h] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11594 int i; // [sp+94h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11595 int X; // [sp+98h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11596
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11597 v2 = a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11598 v3 = a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11599 v4 = v3 + pRenderer->uTargetSurfacePitch * a1->field_A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11600 v5 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11601 v43 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11602 v6 = a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11603 a1a.pColorBuffer = &pRenderer->pTargetSurface[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11604 v46 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11605 v7 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterX - v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11606 v8 = pOutdoorCamera->int_fov_rad_inv * (pViewport->uScreenCenterY - v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11607 a1a.pDepthBuffer = (unsigned int *)&pRenderer->pActiveZBuffer[v3 + 640 * v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11608 v9 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11609 v47 = (Span *)v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11610 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11611 v48 = v9->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11612 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11613 v10 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11614 v11 = X + v10->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11615 v48 = v10->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11616 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11617 v12 = ((unsigned __int64)(v48 * (signed __int64)v8) >> 16) + v5->ptr_38->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11618 X = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11619 v45 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11620 v48 = v5->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11621 X = (unsigned __int64)(v48 * (signed __int64)v8) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11622 v13 = v5->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11623 v14 = X + v5->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11624 v15 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11625 v48 = -v5->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11626 X = ((unsigned __int64)(v7 * (signed __int64)v13) >> 16) + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11627 if ( !X || (v16 = abs(v15 >> 14), v16 > abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11628 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11629 LODWORD(v17) = v48 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11630 HIDWORD(v17) = v48 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11631 i = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11632 v18 = v17 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11633 HIWORD(v19) = (unsigned int)(v17 / X) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11634 LOWORD(v19) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11635 a1a.field_24 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11636 pLOD = v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11637 a1a.pTextureLOD = (unsigned __int16 *)v5->pTexture->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11638 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11639 if ( v18 >= mipmapping_terrain_mm1 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11641 if ( v18 >= mipmapping_terrain_mm2 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11643 if ( v18 >= mipmapping_terrain_mm3 << 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11645 if ( bUseLoResSprites )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11646 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11647 v24 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11648 v49 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11649 pLOD = v24->pLevelOfDetail3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11651 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11653 v23 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11654 v49 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11655 pLOD = v23->pLevelOfDetail2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11656 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11657 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11658 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11660 v22 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11661 v49 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11662 pLOD = v22->pLevelOfDetail1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11665 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11666 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11667 v21 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11668 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11669 pLOD = v21->pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11671 a1a.pTextureLOD = (unsigned __int16 *)pLOD;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11672 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11673 if ( !pLOD )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11674 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11675 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
11676 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11677 v43 = (Span *)(v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11678 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11679 v25 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11680 v48 = v46 - 16 * (v46 >> 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11681 v46 = v25->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11682 X = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11683 v46 = v44 + ((unsigned __int64)(v46 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11684 v44 = v5->ptr_38->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11685 v45 += (unsigned __int64)(v44 * (signed __int64)v7) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11686 X = (unsigned __int64)(v46 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11687 v26 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11688 X = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11689 v27 = ((unsigned __int64)(v46 * (signed __int64)v18) >> 16) - v26->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11690 X = (unsigned __int64)(v45 * (signed __int64)v18) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11691 v28 = v5->ptr_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11692 v29 = v5->pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11693 v44 = bUseLoResSprites + v49 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11694 v30 = v27 >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11695 v31 = (signed int)(((unsigned __int64)(v45 * (signed __int64)v18) >> 16) - v28->field_28) >> v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11696 v32 = (signed int)v29->uTextureWidth >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11697 v33 = (signed int)v29->uTextureHeight >> v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11698 v34 = v49 - v29->uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11699 a1a.field_8 = (v33 << 16) - 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11700 X = 2 * pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11701 v45 = pOutdoorCamera->int_fov_rad_inv;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11702 a1a.field_10 = v34 + 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11703 a1a.field_C = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11704 i = (unsigned __int64)(pOutdoorCamera->int_fov_rad_inv * (signed __int64)i) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11705 v47 = (Span *)(i >> v44);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11706 v35 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11707 v36 = (signed int)v47 * (signed __int64)v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11708 i = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11709 a1a.field_4 = v36 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11710 v37 = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11711 v38 = (signed int)v47 * (signed __int64)v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11712 i = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11713 a1a.field_0 = v38 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11714 if ( (signed int)v43 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11716 v47 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11717 v39 = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11718 for ( i = 12 - v49; ; v39 = i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11719 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11720 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> v39));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11721 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11722 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11723 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11724 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11725 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11726 a1a.field_28 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11727 v30 += 16 * a1a.field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11728 v31 += 16 * a1a.field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11729 v47 = (Span *)((char *)v47 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11730 if ( !v47 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11731 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11734 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11736 i = 12 - v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11737 a1a.field_30 = v30 + 4 * stru_5C6E00->SinCos(X + (v31 >> (12 - v49)));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11738 a1a.field_2C = v31 + 4 * stru_5C6E00->SinCos(X + (v30 >> i) - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11739 a1a.field_28 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11740 if ( byte_4D864C && BYTE1(pGame->uFlags) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11741 sr_sub_485975(&a1a, (stru315 *)&a2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11742 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11743 sr_sub_4D6FB0(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11745 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11746 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11747
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11748
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11749 //----- (0048585C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11750 signed int __fastcall sr_sub_48585C_mb_DrawSpan(Span *a1, unsigned __int16 *pRenderTarget, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11752 Span *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11753 stru148 *v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11754 int v5; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11755 signed __int64 v6; // qtt@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11756 int v7; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11757 signed int v8; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11758 void *v9; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11759 int v10; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11760 unsigned __int16 *pPixels; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11761 signed int v13; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11762 int X; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11763
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11764 v3 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11765 pPixels = pRenderTarget;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11766 v4 = a1->pParent;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11767 v13 = -v4->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11768 X = ((unsigned __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11769 * (pViewport->uScreenCenterX - (signed int)a1->field_8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11770 * (signed __int64)v4->v_18.y) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11771 + ((unsigned __int64)(v4->v_18.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11772 * (signed __int64)(pOutdoorCamera->int_fov_rad_inv
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11773 * (pViewport->uScreenCenterY - (signed int)a1->field_A))) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11774 + v4->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11775 if ( X && (v5 = abs(-v4->field_24 >> 14), v5 <= abs(X)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11776 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11777 LODWORD(v6) = v13 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11778 HIDWORD(v6) = v13 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11779 v7 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11780 v8 = v6 / X;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11781 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11782 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11784 v7 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11785 v8 = pOutdoorCamera->shading_dist_mist << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11786 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11787 v9 = sr_sub_47C178(v8, v4, pOutdoorCamera->terrain_gamma, a4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11788 fill_pixels_fast(*((short *)v9 + v4->pTexture->uDecompressedSize), pPixels, v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11789 HIWORD(v10) = HIWORD(v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11790 LOWORD(v10) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11791 j_memset32(v10, &pRenderer->pActiveZBuffer[v3->field_8 + 640 * v3->field_A], v3->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11792 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11794
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11795 //----- (00485975) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11796 stru315 *__fastcall sr_sub_485975(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11798 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11799 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11800 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11801 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11802 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11803 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11804 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11805 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11806 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11807 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11808 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11809 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11810 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11811
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11812 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11813 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11815 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11816 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11817 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11818 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11819 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11820 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11822 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11823 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11824 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11825 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11826 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11827 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11829 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11831 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11833 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11834 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11835 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11836 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11837 v11 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11838 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11840 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11842 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11844 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11845 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11846 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11847 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11848 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11849 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11850 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11851 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11852 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11854 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11855 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11857
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11858 //----- (00485A24) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11859 stru315 *__fastcall sr_sub_485A24(stru315 *a1, stru315 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11861 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11862 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11863 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11864 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11865 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11866 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11867 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11868 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11869 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11870 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11871 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11872 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11873 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11874 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11875 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11876 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11877
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11878 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11879 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11880 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11881 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11882 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11883 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11884 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11885 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11886 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11887 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11888 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11889 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11890 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11891 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11892 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11893 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11894 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11895 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11896 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11897 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11899 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11900 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11901 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11902 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11903 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11904 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11905 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11906 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11908 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11910 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11911 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11912 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11913 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11914 v14 = (unsigned __int16 *)a2->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11915 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11917 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11919 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11920 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11921 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11922 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11923 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11924 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11925 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11926 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11927 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11928 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11929 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11930 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11931 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11932 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11934
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11935 //----- (00485AFF) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11936 stru315 *__fastcall sr_sub_485AFF(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11937 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11938 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11939 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11940 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11941 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11942 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11943 int v7; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11944 int v8; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11945 int v9; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11946 int v10; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11947 unsigned __int16 *v11; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11948 unsigned int *v12; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11949 int v13; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11950 int v14; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11951
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11952 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11953 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11954 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11955 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11956 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11957 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11958 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11959 v14 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11960 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11962 v7 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11963 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11964 v9 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11965 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11966 v9 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11967 if ( a2->field_8 - v9 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11969 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11970 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11971 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11972 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11973 if ( v7 >= v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11974 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11975 v10 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11976 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11977 v11 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11978 v6 = v14 + (v10 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11980 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11982 v11 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11984 *result->pColorBuffer = v11[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11985 v12 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11986 v13 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11987 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11988 *v12 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11989 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11990 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11991 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11992 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11994 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11995 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11997
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11998 //----- (00485BAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11999 stru315 *__fastcall sr_sub_485BAE(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12001 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12002 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12003 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12004 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12005 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12006 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12007 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12008 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12009 int v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12010 int v11; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12011 int v12; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12012 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12013 unsigned __int16 *v14; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12014 unsigned int *v15; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12015 int v16; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12016 int v17; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12017
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12018 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12019 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12021 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12022 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12023 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12024 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12025 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12026 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12027 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12028 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12029 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12030 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12031 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12032 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12033 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12034 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12035 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12036 v17 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12037 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12039 v10 = HIWORD(a2->field_14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12040 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12041 v12 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12042 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12043 v12 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12044 if ( a2->field_8 - v12 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12046 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12048 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12050 if ( v10 >= v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12051 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12052 v13 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12054 v14 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12055 v9 = v17 + (v13 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12057 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12059 v14 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12061 *result->pColorBuffer = v14[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12062 v15 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12063 v16 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12064 --result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12065 *v15 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12066 --result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12067 a2->field_14 -= a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12068 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12069 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12071 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12072 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12074
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12075 //----- (00485C89) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12076 stru315 *__fastcall sr_sub_485C89(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12078 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12079 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12080 int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12081 int v5; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12082 int v6; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12083 int v7; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12084 int v8; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12085 int v9; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12086 unsigned __int16 *v10; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12087 unsigned int *v11; // ecx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12088 int v12; // esi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12089 int v13; // [sp+0h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12090
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12091 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12092 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12093 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12094 v4 = result->field_8 & result->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12095 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12096 v5 = (result->field_C & HIWORD(result->field_30)) + (v4 >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12097 v6 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12098 v13 = *((char *)result->pTextureLOD + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12099 if ( *((char *)result->pTextureLOD + v5) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12101 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12103 v7 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12104 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12105 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12106 v8 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12107 if ( a2->field_8 - v8 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12109 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12111 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12113 if ( v7 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12114 v7 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12115 v9 = a2->field_8 - v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12117 v10 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12118 v6 = v13 + (v9 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12120 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12122 v10 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12124 *result->pColorBuffer = v10[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12126 v11 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12127 v12 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12128 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12129 *v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12130 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12131 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12132 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12133 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12135 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12136 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12138
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12139 //----- (00485D3E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12140 stru315 *__fastcall sr_sub_485D3E(stru315 *a1, stru316 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12141 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12142 stru315 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12143 int i; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12144 int v4; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12145 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12146 int v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12147 int v7; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12148 int v8; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12149 int v9; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12150 int v10; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12151 int v11; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12152 int v12; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12153 unsigned __int16 *v13; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12154 unsigned int *v14; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12155 int v15; // esi@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12156 int v16; // [sp+0h] [bp-4h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12157
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12158 result = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12159 for ( i = a1->field_28; i; i = result->field_28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12160 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12161 result->field_28 = i - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12162 v4 = result->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12163 if ( result->field_30 > v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12164 result->field_30 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12165 v5 = result->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12166 if ( result->field_2C > v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12167 result->field_2C = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12168 v6 = result->field_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12169 if ( result->field_30 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12170 result->field_30 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12171 v7 = result->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12172 if ( result->field_2C < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12173 result->field_2C = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12174 v8 = (result->field_C & HIWORD(result->field_30)) + ((result->field_2C & result->field_8) >> result->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12175 v9 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12176 v16 = *((char *)result->pTextureLOD + v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12177 if ( *((char *)result->pTextureLOD + v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12179 if ( a2->field_20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12181 v10 = HIWORD(a2->field_10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12182 v11 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12183 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12184 v11 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12185 if ( a2->field_8 - v11 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12187 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12189 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12191 if ( v10 >= a2->field_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12192 v10 = a2->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12193 v12 = a2->field_8 - v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12195 v13 = a2->field_24_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12196 v9 = v16 + (v12 << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12197 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12198 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12200 v13 = result->field_34_palette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12202 *result->pColorBuffer = v13[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12204 v14 = result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12205 v15 = result->field_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12206 ++result->pColorBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12207 *v14 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12208 ++result->pDepthBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12209 a2->field_10 += a2->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12210 result->field_30 += result->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12211 result->field_2C += result->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12213 --result->field_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12214 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12215 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12217 //----- (00485E1F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12218 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
12219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12220 stru316 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12221 signed int *v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12222 signed int *v9; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12223 char v10; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12224 int v11; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12225 Span *v12; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12226 double v13; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12227 double v14; // ST24_8@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12228 int v15; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12229 signed int v16; // ST14_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12230 char v17; // dl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12231 signed int v18; // ST10_4@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12232 void *v19; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12233 signed int v20; // ST14_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12234 char v21; // dl@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12235 int v22; // ST10_4@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12236 signed int v23; // ST14_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12237 char v24; // dl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12238 Span *v26; // [sp+10h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12239 char v27; // [sp+16h] [bp-2h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12240 char v28; // [sp+17h] [bp-1h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12241 float v29; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12242 float v30; // [sp+30h] [bp+18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12244 v7 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12245 v26 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12246 v8 = &a1->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12247 v9 = &a1->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12248 v10 = a1->field_0 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12249 v27 = a1->field_4 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12250 v28 = !v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12251 sr_sub_47BEB1(a3, a4, a5, 0, &a1->field_8, &a1->field_C, (int)&v27, (int)&v28);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12252 v7->field_24_palette = (unsigned __int16 *)sr_sub_47C28C_get_palette(a4, v28, *v9, *v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12253 v11 = a4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12254 v7->field_20 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12255 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12256 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12257 if ( a7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12259 v12 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12260 v29 = v26->field_10 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12261 v13 = v29 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12262 v7->field_10 = LODWORD(v13) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12263 v30 = v12->field_14 * 31.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12264 v14 = v30 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12265 v15 = v7->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12266 v7->field_14 = LODWORD(v14) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12267 v7->field_18 = -((v15 - (LODWORD(v14) << 16)) / v12->field_C);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12268 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12269 v16 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12270 v17 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12271 v18 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12272 v7->field_1C = a6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12273 v19 = sr_sub_47C28C_get_palette(a4, v17, v18, v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12275 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12276 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12277 v20 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12278 v21 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12279 v7->field_10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12280 v7->field_14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12281 v22 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12282 v7->field_18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12283 v7->field_1C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12284 v19 = sr_sub_47C1CA(a4, v21, v22, v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12286 v23 = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12287 v24 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12288 v7->field_24_palette = (unsigned __int16 *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12289 return sr_sub_47C1CA(a4, v24, *v9, v23);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12291
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12292 //----- (00485F53) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12293 void __thiscall sub_485F53(Vec2_int_ *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12295 ++v->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12296 if ( v->y > 1000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12297 v->y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12299
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12300
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12301
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12302 //----- (00485F64) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12303 void OutdoorCamera::_485F64()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12304 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12305 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12306 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12307 signed __int64 v3; // qtt@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12308 int v4; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12310 this->uCameraFovInDegrees = 75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12311 v1 = stru_5C6E00->uPiMask & 0xD5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12312 if ( v1 >= (signed int)stru_5C6E00->uIntegerHalfPi )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12313 v2 = -stru_5C6E00->pTanTable[stru_5C6E00->uIntegerPi - v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12314 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12315 v2 = stru_5C6E00->pTanTable[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12316 LODWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12317 HIDWORD(v3) = (viewparams->uSomeZ - viewparams->uSomeX) << 15 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12318 v4 = (signed int)(v3 / v2) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12319 this->int_fov_rad = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12320 this->field_4C = 360000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12321 this->int_fov_rad_inv = 65536 / v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12322 this->field_50 = 115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12323 unnamed_6BE060[1] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12324 RotationToInts();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12325 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12326
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12327 //----- (0048600E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12328 void OutdoorCamera::RotationToInts()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12329 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12330 camera_rotation_y_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12331 camera_rotation_y_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12332 camera_rotation_x_int_sine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12333 camera_rotation_x_int_cosine = stru_5C6E00->SinCos(pIndoorCamera->sRotationX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12335
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12336
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12337 //----- (0048607B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12338 void stru148::_48607B(stru149 *a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12340 this->pTexture = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12341 this->ptr_38 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12342 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12343
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12344 //----- (00486089) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12345 void stru148::_486089_normalize_v_18()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12346 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12347 stru148 *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12348 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12349 double v3; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12350 float v4; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12351 double v5; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12352 float v6; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12353 double v7; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12354 float v8; // ST24_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12355 float v9; // ST20_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12356 double v10; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12357 float v11; // ST18_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12358 double v12; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12359 float v13; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12360 double v14; // ST0C_8@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12361 float v15; // [sp+20h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12362
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12363 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12364 v2 = (double)this->v_18.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12365 v15 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12366 v3 = (double)this->v_18.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12367 v5 = (double)this->v_18.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12368 v7 = sqrt(v5 * v5 + v3 * v3 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12369 if ( v7 == 0.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12370 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12371 v1->v_18.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12372 v1->v_18.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12373 v1->v_18.z = 65536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12375 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12377 v8 = 1.0 / v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12378 v9 = v8 * v15 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12379 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12380 v1->v_18.x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12381 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12382 v11 = v8 * v4 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12383 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12384 v1->v_18.y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12385 v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12386 v13 = v8 * v6 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12387 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12388 v1->v_18.z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12390 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12391
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12392 //----- (0048616B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12393 int stru149::_48616B(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12395 int v7; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12396 int v8; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12397 int v9; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12398 int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12399 int v11; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12400 int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12401 int v13; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12402 int v14; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12403 int v15; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12404 int v16; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12405 int v17; // ST0C_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12406 int v18; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12407 int v19; // ST0C_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12408 int v20; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12409 int v21; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12410 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12411 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12412 int v24; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12413 int v25; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12414 int v26; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12415 int v27; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12416 int v28; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12417 int v29; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12418
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12419 v25 = pOutdoorCamera->camera_rotation_x_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12420 v7 = pOutdoorCamera->camera_rotation_y_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12421 v27 = pOutdoorCamera->camera_rotation_x_int_sine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12422 v8 = -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12423 v9 = pOutdoorCamera->camera_rotation_y_int_cosine;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12424 v26 = -pIndoorCamera->pos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12425 v24 = -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12426 v10 = pOutdoorCamera->camera_rotation_y_int_cosine * -pIndoorCamera->pos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12427 v11 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12428 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12429 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12430 v14 = v10 + pOutdoorCamera->camera_rotation_y_int_sine * -pIndoorCamera->pos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12431 v15 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12432 this->field_0 = ((unsigned __int64)(v11 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_cosine) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12433 + ((unsigned __int64)(-65536
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12434 * pIndoorCamera->pos.z
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12435 * (signed __int64)pOutdoorCamera->camera_rotation_x_int_sine) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12436 this->field_4 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12437 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12438 v13 = ((unsigned __int64)((v26 << 16) * (signed __int64)v25) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12439 - ((unsigned __int64)(v14 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12441 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12443 this->field_4 = pOutdoorCamera->camera_rotation_y_int_cosine * v8 - pOutdoorCamera->camera_rotation_y_int_sine * v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12444 v12 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12445 this->field_0 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12446 v13 = v26 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12448 this->field_8 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12449 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12451 v17 = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12452 this->field_C = ((unsigned __int64)(v17 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12453 + ((unsigned __int64)(a4 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12454 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12455 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12456 v16 = ((unsigned __int64)(a4 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v17 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12458 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12459 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12460 this->field_C = ((unsigned __int64)(a2 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12461 + ((unsigned __int64)(a3 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12462 this->field_10 = ((unsigned __int64)(a3 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12463 - ((unsigned __int64)(a2 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12464 v16 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12466 this->field_14 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12467 if ( pIndoorCamera->sRotationX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12468 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12469 v19 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12470 this->field_18 = ((unsigned __int64)(v19 * (signed __int64)v12) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12471 + ((unsigned __int64)(a7 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12472 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12473 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12474 v18 = ((unsigned __int64)(a7 * (signed __int64)v12) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12475 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12476 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12478 this->field_18 = ((unsigned __int64)(a5 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12479 + ((unsigned __int64)(a6 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12480 this->field_1C = ((unsigned __int64)(a6 * (signed __int64)v9) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12481 - ((unsigned __int64)(a5 * (signed __int64)v7) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12482 v18 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12484 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12485 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12486 this->field_20 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12487 v20 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12488 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12489 v21 = ((unsigned __int64)(v20 * (signed __int64)this->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12490 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12491 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12492 v28 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12493 v22 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12494 this->field_24 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12495 v29 = (unsigned __int64)(v28 * (signed __int64)v22) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12496 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12497 this->field_28 = v29 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12498 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12499 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12500
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12501 //----- (0048653D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12502 int stru149::_48653D(int a2, int a3, int a4, int a5, int a6, int a7)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12503 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12504 stru149 *v7; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12505 int v8; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12506 int v9; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12507 int v10; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12508 int v11; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12509 int v12; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12510 int v13; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12511 int v14; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12512 int v15; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12513 int v16; // ST14_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12514 int v17; // ST10_4@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12515 int v18; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12516 int v19; // ST10_4@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12517 int v20; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12518 int v21; // ST10_4@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12519 int v22; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12520 int v23; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12521 int v24; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12522 int result; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12523 int v26; // [sp+14h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12524 int v27; // [sp+18h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12525 int v28; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12526 int v29; // [sp+24h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12527 int v30; // [sp+30h] [bp+8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12528 int v31; // [sp+3Ch] [bp+14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12529
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12530 v7 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12531 v8 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12532 v29 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotY - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12533 v28 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12534 v9 = stru_5C6E00->SinCos(pBLVRenderParams->sPartyRotX - stru_5C6E00->uIntegerHalfPi);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12535 v11 = -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12536 v26 = -pBLVRenderParams->vPartyPos.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12537 v27 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12538 v12 = -pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12539 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12541 v16 = v8 * -pBLVRenderParams->vPartyPos.x + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12542 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12543 v17 = -65536 * pBLVRenderParams->vPartyPos.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12544 v7->field_0 = ((unsigned __int64)(v16 * (signed __int64)v28) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12545 + ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12546 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12547 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12548 v15 = ((unsigned __int64)(v17 * (signed __int64)v28) >> 16) - ((unsigned __int64)(v16 * (signed __int64)v27) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12550 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12552 v7->field_0 = v10 + v29 * -pBLVRenderParams->vPartyPos.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12553 v13 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12554 v7->field_4 = v8 * v11 - v29 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12555 v14 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12556 v15 = v12 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12558 v7->field_8 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12559 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12560 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12561 v19 = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12562 v7->field_C = ((unsigned __int64)(v19 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12563 + ((unsigned __int64)(a4 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12564 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12565 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12566 v18 = ((unsigned __int64)(a4 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v19 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12567 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12568 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12569 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12570 v7->field_C = ((unsigned __int64)(a2 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12571 + ((unsigned __int64)(a3 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12572 v7->field_10 = ((unsigned __int64)(a3 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12573 - ((unsigned __int64)(a2 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12574 v18 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12576 v7->field_14 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12577 if ( pBLVRenderParams->sPartyRotX )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12579 v21 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16) + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12580 v7->field_18 = ((unsigned __int64)(v21 * (signed __int64)v13) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12581 + ((unsigned __int64)(a7 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12582 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12583 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12584 v20 = ((unsigned __int64)(a7 * (signed __int64)v13) >> 16) - ((unsigned __int64)(v21 * (signed __int64)v14) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12586 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12588 v7->field_18 = ((unsigned __int64)(a5 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12589 + ((unsigned __int64)(a6 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12590 v7->field_1C = ((unsigned __int64)(a6 * (signed __int64)v8) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12591 - ((unsigned __int64)(a5 * (signed __int64)v29) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12592 v20 = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12594 v7->field_18 = -v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12595 v7->field_1C = -v7->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12596 v7->field_20 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12597 v22 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12598 v7->field_20 = -v7->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12599 v23 = ((unsigned __int64)(v22 * (signed __int64)v7->field_0) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12600 + ((unsigned __int64)(v7->field_10 * (signed __int64)v7->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12601 + ((unsigned __int64)(v7->field_14 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12602 v30 = v7->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12603 v24 = v7->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12604 v7->field_24 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12605 v31 = (unsigned __int64)(v30 * (signed __int64)v24) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12606 result = (unsigned __int64)(v7->field_1C * (signed __int64)v7->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12607 v7->field_28 = v31 + result + ((unsigned __int64)(v7->field_20 * (signed __int64)v7->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12608 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12609 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12610
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12611 //----- (0048694B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12612 int stru149::_48694B()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12614 int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12615 int v2; // ST04_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12616 int v3; // ST00_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12617 int v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12618 int v5; // ST0C_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12619 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12620
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12621 v1 = this->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12622 this->field_18 = -this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12623 this->field_1C = -this->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12624 this->field_20 = -this->field_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12625 v2 = (unsigned __int64)(v1 * (signed __int64)this->field_0) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12626 v3 = this->field_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12627 v4 = this->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12628 this->field_24 = v2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12629 + ((unsigned __int64)(this->field_10 * (signed __int64)this->field_4) >> 16)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12630 + ((unsigned __int64)(this->field_14 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12631 v5 = (unsigned __int64)(v3 * (signed __int64)v4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12632 result = (unsigned __int64)(this->field_1C * (signed __int64)this->field_4) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12633 this->field_28 = v5 + result + ((unsigned __int64)(this->field_20 * (signed __int64)this->field_8) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12634 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12636
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12637
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12638 //----- (00486A28) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12639 void OutdoorCamera::AllocSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12641 if ( !this || !pSpans )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12643 ReleaseSoftwareDrawBuffers();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12644 pSpans = (Span *)pAllocator->AllocNamedChunk(pSpans, 0x493E0u, "SPANS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12645 pEdges = (Edge *)pAllocator->AllocNamedChunk(pEdges, 0x4C2C0u, "EDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12646 pSurfs = (Surf *)pAllocator->AllocNamedChunk(pSurfs, 0x11940u, "SURFS");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12647 pNewEdges = (Edge *)pAllocator->AllocNamedChunk(pNewEdges, 0x6180u, "NEWEDGES");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12648 memset(pSpans, 0, 0x493E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12649 memset(pEdges, 0, 0x4C2C0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12650 memset(pSurfs, 0, 0x11940u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12651 memset(pNewEdges, 0, 0x6180u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12652 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12653 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12654
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12655 //----- (00486AFC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12656 void OutdoorCamera::ReleaseSoftwareDrawBuffers()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12658 pAllocator->FreeChunk(pSpans);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12659 pAllocator->FreeChunk(pEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12660 pAllocator->FreeChunk(pSurfs);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12661 pAllocator->FreeChunk(pNewEdges);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12662 pSpans = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12663 pEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12664 pSurfs = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12665 pNewEdges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12667
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12668 //----- (00486B4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12669 char __fastcall sr_sub_486B4E_push_outdoor_edges(RenderVertexSoft *a1, int *a2, int *a3, stru148 *a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12670 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12671 stru148 *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12672 RenderVertexSoft *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12673 char v6; // zf@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12674 unsigned int v7; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12675 int v8; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12676 int *v9; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12677 int v10; // ebx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12678 int v11; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12679 double v12; // st7@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12680 int *v13; // edx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12681 double v14; // st6@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12682 double v15; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12683 int v16; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12684 double v17; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12685 double v18; // st7@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12686 int v19; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12687 double v20; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12688 double v21; // st7@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12689 Edge *i; // edx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12690 double v23; // st7@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12691 Edge *v24; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12692 std::string v26; // [sp-18h] [bp-98h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12693 const char *v27; // [sp-8h] [bp-88h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12694 int v28; // [sp-4h] [bp-84h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12695 double v29; // [sp+Ch] [bp-74h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12696 double v30; // [sp+14h] [bp-6Ch]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12697 double v31; // [sp+1Ch] [bp-64h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12698 double v32; // [sp+24h] [bp-5Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12699 double v33; // [sp+2Ch] [bp-54h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12700 unsigned int v34; // [sp+34h] [bp-4Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12701 unsigned __int64 v35; // [sp+38h] [bp-48h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12702 int v36; // [sp+40h] [bp-40h]@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12703 int v37; // [sp+44h] [bp-3Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12704 float v38; // [sp+48h] [bp-38h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12705 int v39; // [sp+4Ch] [bp-34h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12706 int v40; // [sp+50h] [bp-30h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12707 int v41; // [sp+54h] [bp-2Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12708 RenderVertexSoft *v42; // [sp+58h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12709 int v43; // [sp+5Ch] [bp-24h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12710 int v44; // [sp+60h] [bp-20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12711 int v45; // [sp+64h] [bp-1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12712 unsigned int v46; // [sp+68h] [bp-18h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12713 int *v47; // [sp+6Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12714 int v48; // [sp+70h] [bp-10h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12715 float *v49; // [sp+74h] [bp-Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12716 float v50; // [sp+78h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12717 float v51; // [sp+7Ch] [bp-4h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12718
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12719 v4 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12720 v5 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12721 v47 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12722 v6 = (HIBYTE(a4->flags) & 0x40) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12723 v42 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12724 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12726 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
12727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12728 LOBYTE(v7) = v4->field_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12729 v8 = v4->uNumVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12730 v4->field_108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12731 BYTE3(a4) = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12732 v41 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12733 if ( v8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12735 if ( (signed int)pOutdoorCamera->uNumSurfs < 1999 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12737 v7 = pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12738 if ( (signed int)pOutdoorCamera->uNumEdges < 5979 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12740 v4->uEdgeList1Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12741 v4->uEdgeList2Size = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12742 v45 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12743 v34 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12744 v28 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12745 v27 = (const char *)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12746 v44 = 10000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12747 pGame->pLightmapBuilder->_45CB89(v5, 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 v9 = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12751 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12752 v49 = &v5->flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12753 v46 = (char *)v47 - (char *)a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12754 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12756 v10 = v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12757 ++pOutdoorCamera->uNumEdges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12758 if ( v48 >= v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12759 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12760 v11 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12761 LODWORD(v50) = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12762 if ( SLODWORD(v50) > v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12763 v45 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12764 if ( v11 < v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12765 v44 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12766 v12 = (double)SLODWORD(v50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12767 v13 = &a3[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12768 v51 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12769 v14 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12770 v50 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12771 *(float *)&v40 = v14 - v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12772 v33 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12773 v43 = LODWORD(v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12774 if ( LODWORD(v33) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12775 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12776 if ( SLODWORD(v33) >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12778 v19 = (int)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12779 ptr_80C978_Edges->field_8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12780 LODWORD(v38) = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12781 v40 = *(unsigned int *)LODWORD(v38) - *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12782 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12783 v20 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12784 v40 = *v13 - *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12785 v21 = v20 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12786 ptr_80C978_Edges->field_4 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12787 ptr_80C978_Edges->field_0 = (v51 - (double)*v9) * v21 + (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12788 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12790 ptr_80C978_Edges->field_1C = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12791 ptr_80C978_Edges->field_20 = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12792 ptr_80C978_Edges->field_24 = (double)*(signed int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12793 ptr_80C978_Edges->field_28 = (double)(signed int)*(unsigned int *)LODWORD(v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12794 ptr_80C978_Edges->field_2C = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12795 ptr_80C978_Edges->field_30 = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12796 v4->pEdgeList1[v4->uEdgeList1Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12797 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12798 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12799 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12800 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12801 v32 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12802 v39 = LODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12803 v51 = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12804 v15 = (double)SLODWORD(v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12805 ptr_80C978_Edges->field_8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12806 v16 = (int)&v47[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12807 v50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12808 v40 = *(int *)((char *)v9 + v46) - *(int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12809 v6 = BYTE3(a4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12810 v17 = (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12811 v40 = *v9 - *v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12812 v18 = v17 / (double)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12813 ptr_80C978_Edges->field_4 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12814 ptr_80C978_Edges->field_0 = (v51 - (double)*v13) * v18 + (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12815 if ( !v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12817 ptr_80C978_Edges->field_1C = v42[v10].flt_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12818 ptr_80C978_Edges->field_20 = *v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12819 ptr_80C978_Edges->field_24 = (double)*(signed int *)v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12820 ptr_80C978_Edges->field_28 = (double)*(int *)((char *)v9 + v46);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12821 ptr_80C978_Edges->field_2C = (double)*v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12822 ptr_80C978_Edges->field_30 = (double)*v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12823 v4->pEdgeList2[v4->uEdgeList2Size++] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12826 v31 = v51 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12827 v37 = LODWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12828 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
12829 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12830 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
12831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12832 ptr_80C978_Edges->pNext = i->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12833 i->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12835 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12837 ptr_80C978_Edges->pNext = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12838 i->pPrev->pNext = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12840 v23 = v50 - 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12841 *(float *)&v40 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12842 v38 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12843 v30 = v38 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12844 v36 = LODWORD(v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12845 ptr_80C978_Edges->ptr_18 = ptr_80CA10[LODWORD(v30)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12846 v29 = *(float *)&v40 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12847 v35 = __PAIR__(v40, LODWORD(v29));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12848 v24 = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12849 ptr_80CA10[LODWORD(v29)] = ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12850 v24->pSurf = ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12851 if ( ptr_80C978_Edges < &pEdges[5999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12852 ++ptr_80C978_Edges;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12854 ++v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12855 v49 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12856 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12858 while ( v48 - 1 < v41 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12860 LOBYTE(v7) = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12861 if ( pOutdoorCamera->uNumEdges != v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12863 v4->ptr_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12864 ptr_80C97C_Surfs->field_22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12865 ptr_80C97C_Surfs->pParent = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12866 ptr_80C97C_Surfs->field_4 = v4->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12867 ptr_80C97C_Surfs->field_8 = v4->field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12868 ptr_80C97C_Surfs->field_0 = v4->field_0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12869 ptr_80C97C_Surfs->field_C = v4->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12870 ptr_80C97C_Surfs->field_10 = v4->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12871 LOBYTE(v7) = (char)pSurfs + 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12872 if ( ptr_80C97C_Surfs < &pSurfs[1999] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12873 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12874 ++ptr_80C97C_Surfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12875 ++pOutdoorCamera->uNumSurfs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12877 if ( BYTE3(a4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12878 v4->field_108 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12882 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12883 return v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12885
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12886
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12887
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12888 //----- (0043F953) --------------------------------------------------------
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
12889 void PrepareWallsRenderList_BLV()
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12891 pStru170->uNumFaceIDs = 0;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12892 if ( pBLVRenderParams->uPartySectorID )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12893 {
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12894 pStru170->field_FA8[0].uSectorID = pBLVRenderParams->uPartySectorID;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12895 pStru170->field_FA8[0].uViewportW = pBLVRenderParams->uViewportW;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12896 pStru170->field_FA8[0].uViewportZ = pBLVRenderParams->uViewportZ;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12897 pStru170->field_FA8[0].uViewportY = pBLVRenderParams->uViewportY;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12898 pStru170->field_FA8[0].uViewportX = pBLVRenderParams->uViewportX;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12899 pStru170->field_FA8[0].field_C._43F9E1(
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12900 pBLVRenderParams->uViewportX,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12901 pBLVRenderParams->uViewportY,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12902 pBLVRenderParams->uViewportZ,
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
12903 pBLVRenderParams->uViewportW);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12904 pStru170->field_FA8[0].uFaceID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12905 pStru170->field_FA8[0].std__vector_0007A8 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12906 pStru170->std__vector_000FA8 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12907 sub_440639(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12908 }
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
12909 pStru170->MakeVisibleSectorList();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12911
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12912 //----- (0043F9E1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12913 __int16 *stru170_stru2::_43F9E1(__int16 x, int y, __int16 z, int w)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12915 signed int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12916 __int16 *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12917
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12918 auto a2 = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12919 auto a3 = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12920 auto a4 = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12921 auto a5 = w;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12922
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12923 this->_viewport_space_y = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12924 this->field_4 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12925 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12926 result = this->array_3D8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12927 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12928 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12929 if ( v5 < a3 || v5 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12931 *result = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12932 *(result - 480) = 640;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12934 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12935 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12936 *(result - 480) = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12937 *result = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12938 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12939 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12940 ++result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12941 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12942 while ( v5 < 480 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12943 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12945
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12946 //----- (0043FA33) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12947 void __fastcall PrepareDecorationsRenderList_BLV(unsigned int uDecorationID, unsigned int uSectorID)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12949 LevelDecoration *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12950 DecorationDesc *v3; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12951 __int16 v4; // ax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12952 double v5; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12953 int v6; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12954 int v7; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12955 unsigned int v8; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12956 int v9; // edi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12957 int v10; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12958 SpriteFrame *v11; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12959 SpriteFrame *v12; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12960 int v13; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12961 int v14; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12962 RenderBillboard *v15; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12963 char v16; // zf@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12964 IndoorCameraD3D **v17; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12965 double v18; // st7@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12966 float v19; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12967 signed __int64 v20; // qtt@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12968 signed __int64 v21; // qtt@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12969 int v22; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12970 int v23; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12971 Particle_ local_0; // [sp+Ch] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12972 double v25; // [sp+74h] [bp-38h]@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12973 unsigned int v26; // [sp+7Ch] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12974 int a2; // [sp+80h] [bp-2Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12975 int a3; // [sp+84h] [bp-28h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12976 int a1; // [sp+88h] [bp-24h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12977 int v30; // [sp+8Ch] [bp-20h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12978 float v31; // [sp+90h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12979 int a5; // [sp+94h] [bp-18h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12980 int z; // [sp+98h] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12981 int a6; // [sp+9Ch] [bp-10h]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12982 int y; // [sp+A0h] [bp-Ch]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12983 int x; // [sp+A4h] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12984 int v37; // [sp+A8h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12985
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12986 v26 = uDecorationID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12987 LODWORD(v31) = uSectorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12988 v2 = &pLevelDecorations[uDecorationID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12989 if ( !(v2->field_2 & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12991 v3 = &pDecorationList->pDecorations[v2->uDecorationDescID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12992 v4 = v3->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12993 if ( (char)v4 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12995 if ( !(v4 & DECORATION_DONT_DRAW) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12997 v6 = v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12998 v7 = v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12999 a2 = v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13000 a1 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13001 a3 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13002 v8 = v2->field_10_y_rot
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13003 + ((signed int)stru_5C6E00->uIntegerPi >> 3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13004 - stru_5C6E00->Atan2(v6 - pBLVRenderParams->vPartyPos.x, a2 - pBLVRenderParams->vPartyPos.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13005 v37 = pBLVRenderParams->field_0_timer_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13006 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13007 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13008 v37 = pMiscTimer->uTotalGameTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13009 v10 = abs(v2->vPosition.x + v2->vPosition.y);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13010 v11 = pSpriteFrameTable->GetFrame(v3->uSpriteID, v37 + v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13011 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13012 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13013 v13 = v11->uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13014 if ( v13 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13015 v30 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13016 if ( v13 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13017 v30 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13018 if ( v13 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13019 LOBYTE(v30) = v30 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13020 if ( (256 << v9) & v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13021 v30 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13022 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(a1, a2, a3, &x, &y, &z, 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13023 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13024 v14 = abs(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13025 if ( v14 >= abs(y) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13027 pGame->pIndoorCameraD3D->Project(x, y, z, &a5, &a6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13028 v15 = &pBillboardRenderList[uNumBillboardsToDraw];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13029 if ( (signed int)uNumBillboardsToDraw < 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13031 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13032 ++uNumDecorationsDrawnThisFrame;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13033 v16 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13034 v15->uHwSpriteID = v12->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13035 v15->uPalette = v12->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13036 v15->uIndoorSectorID = LOWORD(v31);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13037 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13038 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13039 LODWORD(v21) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13040 HIDWORD(v21) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13041 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13042 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13043 v37 = v21 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13044 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v21 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13045 v37 = (unsigned __int64)(v12->scale * (signed __int64)v37) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13046 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13047 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13048 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13049 v17 = &pGame->pIndoorCameraD3D;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13050 v15->fov_x = pGame->pIndoorCameraD3D->fov_x;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13051 v18 = (*v17)->fov_y;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13052 v19 = v15->fov_x;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13053 v15->fov_y = v18;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13054 v31 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13055 v25 = v19 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13056 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13057 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13058 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13059 LODWORD(v31) = v12->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13060 v37 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13061 v15->field_0 = (unsigned __int64)(SLODWORD(v31) * v20 / x) >> 16;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13062 v31 = v15->fov_y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13063 v25 = v31 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13064 LODWORD(v20) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13065 HIDWORD(v20) = SLOWORD(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13066 v37 = v20 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13067 v37 = (unsigned __int64)(v12->scale * v20 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13068 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13069 HIWORD(v22) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13070 v15->field_4 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13071 v15->field_1E = v30;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13072 v15->some_x = a1;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13073 v15->some_y = a2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13074 v15->some_z = a3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13075 v15->uScreenSpaceX = a5;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13076 v15->uScreenSpaceY = a6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13077 v23 = 8 * v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13078 LOBYTE(v23) = 8 * v26 | 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13079 LOWORD(v22) = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13080 v15->uTintColor = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13081 v15->sZValue = v22 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13082 v15->pSpriteFrame = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13083 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13086 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13088 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13089 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13090 memset(&local_0, 0, 0x68u); // fire, like at the Pit's tavern
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13091 v5 = (double)v2->vPosition.x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13092 local_0.bFree = 1036;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13093 local_0.uDiffuse = 0xFF3C1Eu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13094 local_0.x = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13095 local_0.y = (double)v2->vPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13096 local_0.z = (double)v2->vPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13097 local_0.flt_10 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13098 local_0.flt_14 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13099 local_0.flt_18 = 0.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13100 local_0.flt_28 = 1.0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13101 local_0.timeToLive = (rand() & 0x80) + 128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13102 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13103 pGame->pParticleEngine->AddParticle(&local_0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13106 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13109 //----- (0044028F) --------------------------------------------------------
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13110 void PrepareItemsRenderList_BLV()
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13111 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13112 ObjectDesc *v1; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13113 __int16 v2; // ax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13114 RenderBillboard *v3; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13115 SpriteFrame *v4; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13116 SpriteFrame *v5; // ebx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13117 unsigned int v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13118 int v7; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13119 int v8; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13120 int v9; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13121 unsigned __int16 v10; // ax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13122 int *v11; // eax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13123 char v12; // zf@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13124 int v18; // ST5C_4@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13125 signed __int64 v19; // qtt@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13126 int v20; // ST5C_4@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13127 int v21; // edx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13128 __int16 v22; // ax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13129 int v23; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13130 SpriteFrame *v24; // [sp+1Ch] [bp-40h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13131 __int16 a5; // [sp+28h] [bp-34h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13132 int a6; // [sp+2Ch] [bp-30h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13133 int a2; // [sp+30h] [bp-2Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13134 int a1; // [sp+34h] [bp-28h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13135 int v30; // [sp+38h] [bp-24h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13136 int v31; // [sp+38h] [bp-24h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13137 int a3; // [sp+40h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13138 signed __int16 v34; // [sp+44h] [bp-18h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13139 int v35; // [sp+48h] [bp-14h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13140 int v36; // [sp+4Ch] [bp-10h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13141 signed int z; // [sp+50h] [bp-Ch]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13142 signed int y; // [sp+54h] [bp-8h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13143 signed int x; // [sp+58h] [bp-4h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13144
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13145 for (uint i = 0; i < uNumLayingItems; ++i)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13146 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13147 auto p = pLayingItems + i;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13148 if (p->uObjectDescID)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13149 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13150 v1 = &pObjectList->pObjects[p->uObjectDescID];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13151 if ( !(v1->uFlags & 1) )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13152 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13153 if ( ((v2 = p->uItemType, v2 < 1000) || v2 >= 10000)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13154 && (v2 < 500 || v2 >= 600)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13155 && (v2 < 811 || v2 >= 815)
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13156 || pGame->pStru6Instance->_4A81CA(p))
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13157 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13158 a5 = p->uSectorID;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13159 a1 = p->vPosition.x;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13160 a2 = p->vPosition.y;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13161 a3 = p->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13162 v3 = &pBillboardRenderList[uNumBillboardsToDraw];
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13163 v4 = pSpriteFrameTable->GetFrame(v1->uSpriteID, p->uSpriteFrameID);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13164 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13165 v24 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13166 v30 = v4->uFlags;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13167 a6 = v4->uGlowRadius * p->field_22;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13168 v6 = stru_5C6E00->Atan2(
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13169 p->vPosition.x - pBLVRenderParams->vPartyPos.x,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13170 p->vPosition.y - pBLVRenderParams->vPartyPos.y);
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13171 LOWORD(v7) = p->uFacing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13172 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13173 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13174 v10 = v5->pHwSpriteIDs[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13175 v3->uHwSpriteID = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13176 if ( v30 & 0x20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13177 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13178 v8 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13179 a3 -= (signed int)((unsigned __int64)(v5->scale
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13180 * (signed __int64)pSprites_LOD->pSpriteHeaders[(signed __int16)v10].uHeight) >> 16) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13182 v34 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13183 if ( v8 & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13184 v34 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13185 if ( v8 & 0x40000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13186 v34 |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13187 if ( v8 & 0x20000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13188 LOBYTE(v34) = v34 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13189 v11 = (int *)(256 << v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13190 if ( (256 << v9) & v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13191 v34 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13192 if ( a6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13194 LOBYTE(v11) = byte_4E94D3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13195 pMobileLightsStack->AddLight(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13196 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13197 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13198 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13199 a5,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13200 a6,
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13201 v1->uParticleTrailColorR,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13202 v1->uParticleTrailColorG,
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13203 v1->uParticleTrailColorB,
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13204 byte_4E94D3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13206 if ( pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13207 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13208 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13209 a3,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13210 &x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13211 &y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13212 &z,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13213 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13214 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13215 pGame->pIndoorCameraD3D->Project(x, y, z, &v36, &v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13216 if ( (signed int)uNumBillboardsToDraw >= 500 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13217 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13218 ++uNumBillboardsToDraw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13219 ++uNumSpritesDrawnThisFrame;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13220 p->uAttributes |= 1u;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13221 v12 = pRenderer->pRenderD3D == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13222 v3->uPalette = v24->uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13223 v3->uIndoorSectorID = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13224 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13226 LODWORD(v19) = pBLVRenderParams->field_40 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13227 HIDWORD(v19) = pBLVRenderParams->field_40 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13228 v20 = v19 / x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13229 v3->field_0 = (unsigned __int64)(v24->scale * v19 / x) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13230 v31 = (unsigned __int64)(v24->scale * (signed __int64)v20) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13231 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13232 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13233 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13234 v3->fov_x = pGame->pIndoorCameraD3D->fov_x;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13235 v3->fov_y = pGame->pIndoorCameraD3D->fov_y;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13236 v18 = (int)floorf(v3->fov_x + 0.5f) / x;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13237 v3->field_0 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13238 v31 = (unsigned __int64)(v24->scale * (__int64)v18) >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13240 HIWORD(v21) = HIWORD(x);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13241 v3->field_4 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13242 v3->field_1E = v34;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13243 v3->some_x = a1;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13244 v3->some_y = a2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13245 v3->some_z = a3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13246 v3->uScreenSpaceX = v36;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13247 v22 = v35;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13248 v3->uTintColor = 0;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13249 v3->uScreenSpaceY = v22;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13250 LOWORD(v21) = 0;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13251 v23 = 8 * i;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13252 LOBYTE(v23) = 8 * i | 2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13253 v3->pSpriteFrame = v24;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13254 v12 = (p->uAttributes & 0x20) == 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13255 v3->sZValue = v21 + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13256 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13257 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13258 if ( !pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13259 v3->sZValue = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13262 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13264 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13266 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13268
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13269
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13270 //----- (00440639) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13271 void __fastcall sub_440639(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13273 int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13274 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13275 BLVSector *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13276
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13277 v1 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13278 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13279 v3 = &pIndoor->pSectors[pStru170->field_FA8[a1].uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13280 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13281 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13282 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13283 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13284 do
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13285 {
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13286 Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13287 pStru170->PrepareFaceRenderList_d3d(v1, v3->pFaceIDs[v2++]);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13288 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13289 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13290 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13292 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13293 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13294 if ( v3->uNumNonBSPFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13295 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13296 do
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13297 pStru170->PrepareFaceRenderList_sw(v1, v3->pFaceIDs[v2++]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13298 while ( v2 < v3->uNumNonBSPFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13299 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13301 if ( v3->field_0 & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13302 sub_4406BC(v1, v3->uFirstBSPNode);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13304
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13305 //----- (004406BC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13306 void __fastcall sub_4406BC(int a1, unsigned int uFirstNode)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13307 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13308 BLVSector *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13309 BSPNode *v3; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13310 BLVFace *v4; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13311 int v5; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13312 __int16 v6; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13313 int v7; // ebp@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13314 int v8; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13315 __int16 v9; // di@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13316 int v10; // [sp+10h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13317 bool v11; // [sp+14h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13318 stru170_stru0 *v12; // [sp+18h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13319
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13320 Log::Warning(L"sub_4406BC(%u, %u)", a1, uFirstNode);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13321
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13322 v10 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13323 v12 = &pStru170->field_FA8[a1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13324 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13326 v2 = &pIndoor->pSectors[v12->uSectorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13327 v3 = &pIndoor->pNodes[uFirstNode];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13328 v4 = &pIndoor->pFaces[v2->pFaceIDs[v3->uCoplanarOffset]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13329 v5 = v4->pFacePlane_old.dist
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13330 + pBLVRenderParams->vPartyPos.x * v4->pFacePlane_old.vNormal.x
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13331 + pBLVRenderParams->vPartyPos.y * v4->pFacePlane_old.vNormal.y
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13332 + pBLVRenderParams->vPartyPos.z * v4->pFacePlane_old.vNormal.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13333 if ( v4->uAttributes & 1 && v4->uSectorID != v12->uSectorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13334 v5 = -v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13335 v11 = v5 > 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13336 if ( v5 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13337 v6 = v3->uFront;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13338 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13339 v6 = v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13340 if ( v6 != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13341 sub_4406BC(v10, v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13342 v7 = v3->uCoplanarOffset;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13343 v8 = v7 + v3->uCoplanarSize;
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13344
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13345 Log::Warning(L"Node %u: %X to %X (%hX)", uFirstNode, v7, v8, v2->pFaceIDs[v7]);
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13346
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13347 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13349 while ( v7 < v8 )
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13350 pStru170->PrepareFaceRenderList_d3d(v10, v2->pFaceIDs[v7++]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13351 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13352 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13353 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13354 while ( v7 < v8 )
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13355 pStru170->PrepareFaceRenderList_sw(v10, v2->pFaceIDs[v7++]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13357 v9 = v11 ? v3->uFront : v3->uBack;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13358 if ( v9 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13359 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13360 uFirstNode = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13363
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13364 //----- (00440DF5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13365 int stru167_wrap::Push(__int16 a2, __int16 a3, __int16 a4, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13366 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13367 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13368
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13369 pElements[uNumElements].field_6_rnd_value = a2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13370 pElements[uNumElements].field_8_rnd_value = a3;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13371 pElements[uNumElements].field_A_rnd_value = a4;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13372 pElements[uNumElements].field_C_time_left = rand() % 64 + 256;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13373 pElements[uNumElements].field_E_time_to_live = pElements[uNumElements].field_C_time_left;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13374 result = 3 * uNumElements;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13375 pElements[uNumElements++].bgr16 = bgr;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13376 if (uNumElements >= 100 )
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13377 uNumElements = 0;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13378 return result;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13379 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13380
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13381 //----- (00440E91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13382 void stru167_wrap::_440E91(__int16 x, int y, int z, int a5, __int16 bgr)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13384 stru167_wrap *v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13385 int i; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13386 int v8; // ST08_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13387 int v9; // ST04_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13388 int v10; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13389
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13390 v6 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13391 for ( i = 0; i < rand() % 6 + 5; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13393 v8 = z + rand() % 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13394 v9 = rand() % 33 + y - 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13395 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13396 Push(v10 % 33 + x - 16, v9, v8, a5, bgr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13397 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13399
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13400 //----- (00440F07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13401 void stru167_wrap::_440F07()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13402 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13403 for (uint i = 0; i < 100; ++i)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13404 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13405 if (pElements[i].field_C_time_left > 0)
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13406 {
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13407 pElements[i].field_A_rnd_value += rand() % 5 + 4;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13408 pElements[i].field_6_rnd_value += rand() % 5 - 2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13409 pElements[i].field_8_rnd_value += rand() % 5 - 2;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13410 pElements[i].field_C_time_left -= (short)pEventTimer->uTimeElapsed;
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13411 }
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13412 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13414
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13415 //----- (0044100D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13416 bool __cdecl sub_44100D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13417 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13418 return pCurrentScreen == 4
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13419 || pCurrentScreen == 7
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13420 || pCurrentScreen > 12
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13421 && (pCurrentScreen <= 14
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13422 || pCurrentScreen > 16
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13423 && (pCurrentScreen <= 18
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13424 || pCurrentScreen == 23));
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13425 }
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13426 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13427
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13428 //----- (00441498) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13429 void __cdecl GameUI_DrawTorchlightAndWizardEye()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13431 unsigned int v0; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13432 IconFrame *v1; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13433 unsigned int v2; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13434 IconFrame *v3; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13435
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13436 if ( !pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13437 || pCurrentScreen == 1
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13438 || pCurrentScreen == 2
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13439 || pCurrentScreen == 5
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13440 || pCurrentScreen == 8
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13441 || pCurrentScreen == 10
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13442 || pCurrentScreen == 11
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13443 || pCurrentScreen == 12
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13444 || pCurrentScreen == 15
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13445 || pCurrentScreen == 3
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13446 || pCurrentScreen == 19 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13448 if ( SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13449 && (SHIDWORD(pParty->pPartyBuffs[16].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[16].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13451 v0 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13452 v1 = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13453 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13454 pUIAnum_Torchlight->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13455 pUIAnum_Torchlight->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13456 &pIcons_LOD->pTextures[v1->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13458 if ( SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13459 && (SHIDWORD(pParty->pPartyBuffs[19].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[19].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13460 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13461 v2 = pEventTimer->Time();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13462 v3 = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13463 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13464 pUIAnim_WizardEye->x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13465 pUIAnim_WizardEye->y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13466 &pIcons_LOD->pTextures[v3->uTextureID]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13469 }
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13470 // 4E28F8: using guessed type int pCurrentScreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13471
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13472 //----- (0044158F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13473 void __cdecl GameUI_DrawCharacterSelectionFrame()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13474 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13475 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13476 pRenderer->DrawTextureTransparent(
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13477 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13478 0x17Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13479 &pIcons_LOD->pTextures[dword_50C98C]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13480 }
50
fde5c5acb66e BLV render
Nomad
parents: 47
diff changeset
13481
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13482
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13483 //----- (004415C5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13484 void __cdecl Load_isn_spells_21_27()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13485 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13486 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13487 char pContainer[120]; // [sp+8h] [bp-20h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13488
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13489 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13490 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13492 sprintf(pContainer, "isn-%02d", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13493 pTextureIDs_isns[v0++] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13494 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13495 while ( v0 < 14 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13496 uIconIdx_Spell21 = pIconsFrameTable->FindIcon("spell21");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13497 uIconIdx_Spell27 = pIconsFrameTable->FindIcon("spell27");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13498 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13499
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13500 //----- (0044162D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13501 void __cdecl GameUI_DrawPartySpells()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13502 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13503 unsigned int v0; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13504 signed int v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13505 int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13506 int v3; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13507 __int16 *v4; // ebx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13508 Player *v5; // edi@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13509 unsigned int v6; // [sp-4h] [bp-1Ch]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13510 Texture *v7; // [sp-4h] [bp-1Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13511 unsigned int v8; // [sp-4h] [bp-1Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13512 Texture *v9; // [sp-4h] [bp-1Ch]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13513 Player **v10; // [sp+10h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13514
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13515 v0 = (signed __int64)((double)GetTickCount() * 0.050000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13516 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13517 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13519 v2 = (unsigned __int8)byte_4E5DD8[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13520 if ( SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13521 && (SHIDWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[v2].uExpireTime) > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13523 v3 = pTextureIDs_isns[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13524 pRenderer->_4A65CC(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13525 pPartySpellbuffsUI_XYs[v1][0],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13526 pPartySpellbuffsUI_XYs[v1][1],
47
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
13527 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0),
8a8dd0164b12 BLV render
Nomad
parents: 46
diff changeset
13528 (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13529 v0 + 20 * pPartySpellbuffsUI_smthns[v1],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13530 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13531 63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13532 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13533 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13534 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13535 while ( v1 < 14 );
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13536 if ( !pCurrentScreen
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
13537 || pCurrentScreen == 4 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13538 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13539 if ( (signed __int64)pParty->pPartyBuffs[7].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13541 if ( pParty->bFlying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13542 v6 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13543 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13544 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13545 v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell21, v6)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13546 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13547 pRenderer->DrawTextureIndexed(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13548 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13549 pRenderer->DrawTextureTransparent(8u, 8u, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13551 if ( SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) >= 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13552 && (SHIDWORD(pParty->pPartyBuffs[18].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[18].uExpireTime)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13554 if ( pParty->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13555 v8 = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13556 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13557 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13558 v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_Spell27, v8)->uTextureID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13559 if ( pRenderer->pRenderD3D )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13560 pRenderer->DrawTextureIndexed(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13561 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13562 pRenderer->DrawTextureTransparent(396u, 8u, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13564 }
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13565
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13566 uint _it = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13567 v10 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13568 v4 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13569 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13570 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13571 v5 = *v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13572 if ( (signed __int64)(*v10)->pPlayerBuffs[6].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13573 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13574 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13575 0x1ABu,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13576 (Texture *)(dword_507964 != -1 ? &pIcons_LOD->pTextures[dword_507964] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13577 if ( (signed __int64)v5->pPlayerBuffs[1].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13578 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13579 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13580 0x189u,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13581 (Texture *)(dword_50796C != -1 ? &pIcons_LOD->pTextures[dword_50796C] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13582 if ( (signed __int64)v5->pPlayerBuffs[11].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13583 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13584 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13585 0x19Au,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13586 (Texture *)(dword_507968 != -1 ? &pIcons_LOD->pTextures[dword_507968] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13587 if ( (signed __int64)v5->pPlayerBuffs[10].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13588 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13589 *v4 + 72,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13590 0x1BCu,
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13591 (Texture *)(dword_507960 != -1 ? &pIcons_LOD->pTextures[dword_507960] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13592 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13593 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13594 }
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13595 //while ( (signed int)v4 < (signed int)pBaseHealthByClass );
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
13596 while (++_it != 4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13597 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13598
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13600 //----- (00441A4E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13601 __int16 __fastcall sub_441A4E(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13603 __int16 result; // ax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13604 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13605 char *v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13606 int v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13607 int v5; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13608 SpriteFrame *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13609 SpriteFrame *v7; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13610 int v8; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13611 unsigned __int16 v9; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13612 RenderBillboardTransform_local0 v10; // [sp+Ch] [bp-5Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13613 int v11; // [sp+5Ch] [bp-Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13614 int v12; // [sp+60h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13615 int v13; // [sp+64h] [bp-4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13616
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13617 v10.uParentBillboardID = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13618 v10.pTarget = pRenderer->pTargetSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13619 v10.pTargetZ = pRenderer->pActiveZBuffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13620 v10.uTargetPitch = pRenderer->field_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13621 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13622 v2 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13623 v10.uViewportX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13624 v10.uViewportY = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13625 v10.uViewportZ = 639;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13626 v10.uViewportW = 479;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13627 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13628 v3 = (char *)&pOtherOverlayList->pOverlays[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13629 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13631 if ( *((short *)v3 - 3) > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13633 result = *((short *)v3 - 6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13634 if ( result >= 300 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13635 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13636 v4 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13637 v5 = result == v2 + 320 | result == v2 + 330 | result == v2 + 340 | result == v2 + 350;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13638 result = v2 + 310;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13639 if ( v4 == v2 + 310 | v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13641 if ( !*(short *)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13643 v6 = pSpriteFrameTable->GetFrame(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13644 pOverlayList->pOverlays[*((short *)v3 - 5)].uSpriteFramesetID,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13645 *((short *)v3 - 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13646 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13647 v11 = *((int *)v3 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13648 v13 = v6->scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13649 v13 = (unsigned __int64)(v11 * (signed __int64)v13) >> 16;
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13650 v10.uScreenSpaceX = *((short *)v3 - 2);
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13651 v10.uScreenSpaceY = *((short *)v3 - 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13652 v10.field_10 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13653 v10.field_14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13654 v10.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v6->uPaletteIndex, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13655 v8 = *((short *)v3 - 5);
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13656 v10.sZValue = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13657 v10.uFlags = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13658 v9 = pOverlayList->pOverlays[v8].uOverlayType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13659 if ( !v9 || v9 == 2 )
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
13660 v10.uScreenSpaceY += pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]].uHeight >> 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13661 result = pSprites_LOD->pSpriteHeaders[v7->pHwSpriteIDs[0]]._4AD2D1(&v10, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13662 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13663 if ( v12 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13664 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13668 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13669 v3 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13670 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13671 while ( (signed int)v3 < (signed int)&pOverlayList->pOverlays );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13672 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13674
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13675
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13676
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13677 //----- (00441D38) --------------------------------------------------------
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13678 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int flags)
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13679 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13680 int uHeight; // ebx@6
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13681 //unsigned int v9; // edx@9
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13682 //unsigned int v10; // ebx@10
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13683 __int16 v11; // cx@11
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13684 //BLVFace *v12; // ecx@17
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13685 //unsigned int v13; // ecx@21
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13686 unsigned int v14; // ebx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13687 int v15; // eax@23
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13688 //unsigned int *v16; // ecx@28
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13689 __int16 v17; // di@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13690 double v18; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13691 float v19; // ST38_4@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13692 double v20; // st7@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13693 double v21; // st6@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13694 double v22; // st5@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13695 unsigned __int16 *v26; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13696 signed int v27; // eax@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13697 unsigned __int16 *v28; // ecx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13698 signed int v29; // edi@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13699 int v30; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13700 unsigned __int16 *v31; // ebx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13701 signed int v32; // edi@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13702 signed int v33; // ebx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13703 unsigned int v34; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13704 signed int v35; // ecx@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13705 unsigned __int16 v36; // di@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13706 int v37; // edi@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13707 int v38; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13708 __int16 v39; // ax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13709 int v40; // edi@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13710 int v41; // ebx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13711 unsigned int v42; // eax@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13712 unsigned int v43; // ebx@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13713 unsigned int v44; // ST30_4@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13714 char *v45; // ebx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13715 int v46; // edi@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13716 int v47; // eax@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13717 unsigned int v48; // ebx@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13718 unsigned int v49; // ST64_4@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13719 double v50; // ST20_8@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13720 unsigned int v51; // [sp-10h] [bp-64h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13721 unsigned int v52; // [sp-10h] [bp-64h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13722 unsigned int v53; // [sp-Ch] [bp-60h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13723 unsigned int v54; // [sp-Ch] [bp-60h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13724 unsigned int v55; // [sp-8h] [bp-5Ch]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13725 unsigned int v56; // [sp-8h] [bp-5Ch]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13726 signed int v57; // [sp-4h] [bp-58h]@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13727 unsigned __int16 v58; // [sp-4h] [bp-58h]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13728 unsigned __int16 v59; // [sp-4h] [bp-58h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13729 unsigned __int16 v60; // [sp+10h] [bp-44h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13730 unsigned int v61; // [sp+10h] [bp-44h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13731 unsigned __int16 *v62; // [sp+14h] [bp-40h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13732 unsigned int v63; // [sp+14h] [bp-40h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13733 int v64; // [sp+18h] [bp-3Ch]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13734 unsigned int v65; // [sp+18h] [bp-3Ch]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13735 unsigned int lPitch; // [sp+20h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13736 unsigned int lPitcha; // [sp+20h] [bp-34h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13737 char *lPitchb; // [sp+20h] [bp-34h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13738 unsigned int v69; // [sp+24h] [bp-30h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13739 signed int v70; // [sp+24h] [bp-30h]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13740 unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13741 signed int uBluea; // [sp+28h] [bp-2Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13742 int v73; // [sp+2Ch] [bp-28h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13743 unsigned __int8 *v74; // [sp+30h] [bp-24h]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13744 int v76; // [sp+34h] [bp-20h]@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13745 int v77; // [sp+34h] [bp-20h]@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13746 signed int v78; // [sp+38h] [bp-1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13747 int v79; // [sp+38h] [bp-1Ch]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13748 signed int a2b; // [sp+40h] [bp-14h]@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13749 char *a2c; // [sp+40h] [bp-14h]@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13750 int a3a; // [sp+44h] [bp-10h]@40
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13751 signed int uCenterY; // [sp+48h] [bp-Ch]@1
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13752 signed int uCenterX; // [sp+4Ch] [bp-8h]@1
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13753 //signed int uZb; // [sp+5Ch] [bp+8h]@27
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13754 signed int uWidth; // [sp+5Ch] [bp+8h]@30
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13755 signed int uZd; // [sp+5Ch] [bp+8h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13756 signed int uZe; // [sp+5Ch] [bp+8h]@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13757 signed int uZf; // [sp+5Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13758 signed int uZg; // [sp+5Ch] [bp+8h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13759 unsigned int uWa; // [sp+60h] [bp+Ch]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13760 float uWb; // [sp+60h] [bp+Ch]@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13761 unsigned __int16 *uWc; // [sp+60h] [bp+Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13762 unsigned int uWd; // [sp+60h] [bp+Ch]@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13763 float uZooma; // [sp+64h] [bp+10h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13764 signed int flagsa; // [sp+68h] [bp+14h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13765 unsigned int flagsb; // [sp+68h] [bp+14h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13766 char *flagsc; // [sp+68h] [bp+14h]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13767 unsigned int flagsd; // [sp+68h] [bp+14h]@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13768
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13769 //a3 = uY;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13770 //a2 = uX;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13771 uCenterX = (uX + uZ) / 2;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13772 uCenterY = (uY + uW) / 2;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13773 lPitch = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13774 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13775 uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13776 auto bWizardEyeActive = pParty->WizardEyeActive();
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13777 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel();
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13778 if (CheckHiredNPCSpeciality(0x26u))
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13779 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13780 bWizardEyeActive = true;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13781 uWizardEyeSkillLevel = 2;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13782 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13783 pRenderer->Clip_v2(uX, uY, uZ - 1, uW - 1);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13784 uHeight = uW - uY;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13785 uWidth = uZ - uX;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13786
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13787 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13789 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13790 v74 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13791 v62 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13792 v73 = (1 << (v17 + 16)) / (signed int)uZoom;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13793 v18 = (double)(1 << (16 - v17));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13794 v19 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13795 v20 = (double)(pParty->vPosition.x + 32768) / v18;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13796 v21 = (double)(32768 - pParty->vPosition.y) / v19;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13797 uWb = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13798 if ( uZoom == 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13799 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13800 v20 = v20 - (double)(uWidth / 2);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13801 v22 = (double)(uHeight / 2);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13802 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13803 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13805 if ( uZoom == 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13806 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13807 v20 = v20 - (double)(uWidth / 4);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13808 v22 = (double)(uHeight / 4);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13810 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13812 if ( uZoom != 2048 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13813 goto LABEL_37;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13814 v20 = v20 - (double)(uWidth / 8);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13815 v22 = (double)(uHeight / 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13817 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13818 uWb = v21 - v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13819 LABEL_37:
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13820 //v23 = v20 * 65536.0;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13821 //v24 = v23 + 6.7553994e15;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13822 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13823 //uWe = uWb * 65536.0;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13824 //v25 = uWe + 6.7553994e15;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13825 v78 = v70;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13826 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13827 v26 = (unsigned __int16 *)_56EFD8_minimap;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13828 v27 = uBluea >> 16;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13829 uWc = (unsigned __int16 *)_56EFD8_minimap;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13830 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13831 if ( flags )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13832 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13833 if ( v74 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13835 v64 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13836 if ( uHeight > 0 )
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13837 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13838 a3a = uHeight;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13839 v29 = v70 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13840 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13842 a2b = 0;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13843 if ( uWidth > 0 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13845 v30 = (int)&v74[v27 * v64];
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13846 flagsa = uWidth;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13847 a2b = uWidth;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13848 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13850 v31 = uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13851 ++uWc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13852 *v31 = v62[*(char *)(v30 + v29)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13853 v78 += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13854 v29 = v78 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13855 --flagsa;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13857 while ( flagsa );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13859 v78 = v70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13860 v29 = v70 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13861 v28 += 137 - a2b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13862 uBluea += v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13863 v27 = uBluea >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13864 --a3a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13866 while ( a3a );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13867 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13869 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13870 uZd = 117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13871 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13873 v32 = 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13874 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13875 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13876 *v28 = *v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13877 ++v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13878 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13879 --v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13880 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13881 while ( v32 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13882 v28 += lPitch - 137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13883 --uZd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13884 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13885 while ( uZd );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13886 uNumBlueFacesInBLVMinimap = 0;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13887 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13888 else
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13889 {
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13890 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13891 uNumBlueFacesInBLVMinimap = 0;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13892
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13893 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13894 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13895 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i];
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13896
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13897 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13898 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13899 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13900 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13901 if (pFace1->Visible() && pFace2->Visible())
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13902 {
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13903 v11 = pOutline->uFlags;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13904 if ( v11 & 1 )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13905 goto LABEL_15;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13906 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 )
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13907 goto LABEL_ABC;
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13908
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13909 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13910 continue;
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13911
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13912 LABEL_ABC:
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13913 pOutline->uFlags = v11 | 1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13914 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13915
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13916 LABEL_15:
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13917 //v12 = &pIndoor->pFaces[pOutline->uFace1ID];
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13918 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 &&
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13919 (pFace1->uAttributes & 0x2000000 || pFace2->uAttributes & 0x2000000) &&
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13920 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID))
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13921 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13922 if (uNumBlueFacesInBLVMinimap < 49)
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13923 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13924 }
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13925 else
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13926 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13927 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13928 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13929 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13930 v69 = uCenterX + _c;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13931 v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13932 lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13933 uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13934 v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16);
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13935 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13936 if ( v15 > 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13937 v15 = 100;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13938 pRenderer->Line2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13939 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13940 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13941
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13942
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13943 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13944 {
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13945 //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]];
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
13946 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]];
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13947 pRenderer->Line2D(
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13948 uCenterX
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13949 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13950 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13951 - uZoom * pParty->vPosition.x) >> 16),
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13952 uCenterY
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13953 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13954 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13955 - uZoom * pParty->vPosition.y) >> 16),
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13956 uCenterX
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13957 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13958 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13959 - uZoom * pParty->vPosition.x) >> 16),
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13960 uCenterY
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13961 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
13962 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16)
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
13963 - uZoom * pParty->vPosition.y) >> 16),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13964 uBlue);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13965 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13966 }
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13967
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13968
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
13969 //_draw_party_arrow:
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13970 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13971 v34 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13972 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13973 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) < 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13974 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13975 if ( (signed int)v34 <= 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13976 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13977 v35 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13978 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13980 if ( (signed int)v34 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13981 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13982 if ( (signed int)v34 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13984 if ( (signed int)v34 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13986 if ( (signed int)v34 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13987 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13988 if ( (signed int)v34 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13989 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13990 if ( (signed int)v34 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13991 goto LABEL_66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13992 v57 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13993 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13994 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13995 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13996 v57 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13998 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13999 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14001 v57 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14003 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14004 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14005 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14006 v57 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14007 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14008 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14009 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14011 v57 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14013 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14014 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14015 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14016 v57 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14017 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14018 v35 = v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14019 LABEL_66:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14020 pRenderer->DrawTextureTransparent(
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14021 uCenterX - 3,
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14022 uCenterY - 3,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14023 (Texture *)(pTextureIDs_pMapDirs[v35] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v35]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14024 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14025 flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14026 v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14027 if ( bWizardEyeActive )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14028 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14029 uZe = 0;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
14030 //for (uint i = 0; i < uNumLayingItems; ++i)
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
14031 if (uNumLayingItems > 0)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14033 a2c = (char *)&pLayingItems[0].uObjectDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14034 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14035 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14036 if ( !*((short *)a2c - 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14037 || !*(short *)a2c
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14038 || uWizardEyeSkillLevel == 1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14039 || (v37 = ((unsigned __int64)((*(int *)(a2c + 2) - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16)
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14040 + uCenterX,
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14041 v79 = (unsigned __int64)((*(int *)(a2c + 6) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16,
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14042 v38 = uCenterY - v79,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14043 v37 < pRenderer->field_1C_clipx)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14044 || v37 > pRenderer->field_24_clipz
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14045 || v38 < pRenderer->field_20_clipy
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14046 || v38 > pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14047 goto LABEL_83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14048 if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14049 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14050 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14051 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14052 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14053 pRenderer->Line2D(v37, v38 - 2, v37, v38 + 1, flagsb);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14054 pRenderer->Line2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14055 pRenderer->Line2D(v37 - 2, v38, v37 - 2, v38 + 1, flagsb);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14056 v37 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14057 v58 = flagsb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14058 v55 = v38 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14059 goto LABEL_81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14060 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14061 pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, uCenterY - v79, flagsb);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14062 v58 = flagsb;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14063 v55 = uCenterY - v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14064 v53 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14065 v51 = v38 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14066 LABEL_82:
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14067 pRenderer->Line2D(v37, v51, v53, v55, v58);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14068 LABEL_83:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14069 ++uZe;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14070 a2c += 112;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14071 if ( uZe >= (signed int)uNumLayingItems )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14073 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14074 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14075 goto LABEL_85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14076 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14077 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14078 v58 = v60;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14079 v55 = uCenterY - v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14080 LABEL_81:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14081 v53 = v37;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14082 v51 = uCenterY - v79;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14083 goto LABEL_82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14085 LABEL_85:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14086 v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, 0, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14087 v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14088 v65 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14089 uZf = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14090 if ( (signed int)uNumActors > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14091 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14092 flagsc = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14093 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14094 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14095 v39 = *(short *)flagsc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14096 if ( *(short *)flagsc != 11 && v39 != 19 && (v39 == 5 || *(flagsc - 139) & 0x80) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14098 v40 = ((unsigned __int64)(((signed int)*((short *)flagsc - 17) - pParty->vPosition.x)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14099 * (signed __int64)(signed int)uZoom) >> 16)
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14100 + uCenterX;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14101 v76 = (unsigned __int64)(((signed int)*((short *)flagsc - 16) - pParty->vPosition.y)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14102 * (signed __int64)(signed int)uZoom) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14103 v41 = uCenterY - v76;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14104 if ( v40 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14105 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14106 if ( v40 <= pRenderer->field_24_clipz && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14108 uWd = v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14109 if ( *(flagsc - 137) & 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14110 uWd = v63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14111 if ( *(short *)flagsc == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14112 uWd = v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14113 if ( (signed int)uZoom > 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14114 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14115 pRenderer->Line2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14116 pRenderer->Line2D(v40, v41 - 2, v40, v41 + 2, uWd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14117 pRenderer->Line2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14118 v42 = v41 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14119 v43 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14120 v44 = v42;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14121 pRenderer->Line2D(v40 - 2, v43, v40 - 2, v42, uWd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14122 v40 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14123 v59 = uWd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14124 v56 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14125 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14126 v52 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14127 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14128 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14129 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14130 pRenderer->Line2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14131 v59 = uWd;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14132 v56 = uCenterY - v76;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14133 v54 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14134 v52 = v41 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14135 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14136 pRenderer->Line2D(v40, v52, v54, v56, v59);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14138 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14140 ++uZf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14141 flagsc += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14142 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14143 while ( uZf < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14144 v36 = 255;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14145 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14147 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14148 flagsd = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v36, v36, v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14149 uZg = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14150 if ( (signed int)uNumLevelDecorations > v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14151 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14152 v45 = (char *)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14153 lPitchb = (char *)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14154 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14155 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14156 if ( *(v45 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14158 v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16)
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14159 + uCenterX;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14160 v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14161 v47 = uCenterY - v77;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14162 if ( v46 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14163 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14164 if ( v46 <= pRenderer->field_24_clipz && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14165 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14166 if ( (signed int)uZoom > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14167 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14168 v48 = v47 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14169 v49 = v47 - 1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14170 pRenderer->Line2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14171 pRenderer->Line2D(v46, v49, v46, v48, flagsd);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14172 pRenderer->Line2D(v46 + 1, v49, v46 + 1, v48, flagsd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14173 v45 = lPitchb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14175 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14176 {
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14177 pRenderer->Line2D(v46, uCenterY - v77, v46, uCenterY - v77, flagsd);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14178 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14179 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14181 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14182 ++uZg;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14183 v45 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14184 lPitchb = v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14185 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14186 while ( uZg < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14187 v33 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14188 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14189 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14190 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14191 v33,
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
14192 (Texture *)(dword_5079D8 != -1 ? &pIcons_LOD->pTextures[dword_5079D8] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14193 uZooma = (double)pParty->sRotationY * 0.1171875;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14194 v50 = uZooma + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14195 pRenderer->Clip(0x21Du, v33, 0x237u, 0x1E0u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14196 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14197 LODWORD(v50) + 285,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14198 0x88u,
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
14199 (Texture *)(dword_5079B4 != -1 ? &pIcons_LOD->pTextures[dword_5079B4] : 0));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14200 pRenderer->ResetClip();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14202
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14203
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14204 //----- (00442955) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14205 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
14206 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14207 int v5; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14208 int v6; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14209 unsigned int *v7; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14210 unsigned __int8 v8; // zf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14211 unsigned __int8 v9; // sf@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14212 int v10; // esi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14213 unsigned int v11; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14214 __int16 v12; // cx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14215 signed int v13; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14216 int v14; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14217 Vec3_short_ *v15; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14218 int v16; // edx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14219 int v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14220 Vec3_short_ *v18; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14221 int v19; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14222 int v20; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14223 signed int v21; // esi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14224 int v22; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14225 int v23; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14226 Vec3_short_ *v24; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14227 Vec3_short_ *v25; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14228 int v26; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14229 unsigned __int16 *v27; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14230 int v28; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14231 int v29; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14232 double v30; // st7@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14233 signed __int64 v31; // qax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14234 char *v32; // edx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14235 int v33; // esi@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14236 signed int v34; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14237 signed int v35; // ecx@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14238 int v36; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14239 int v37; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14240 int v38; // edx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14241 unsigned int v39; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14242 const void *v40; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14243 unsigned __int16 *v41; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14244 unsigned __int8 v42; // cf@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14245 unsigned int v43; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14246 int v44; // edi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14247 int v45; // esi@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14248 int v46; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14249 signed int v47; // esi@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14250 signed int v48; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14251 int v49; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14252 signed int v50; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14253 unsigned int v51; // ecx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14254 int result; // eax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14255 int v53; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14256 int v54; // esi@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14257 int v55; // eax@75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14258 __int16 v56; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14259 double v57; // st7@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14260 int v58; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14261 signed __int64 v59; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14262 signed int v60; // edi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14263 signed __int64 v61; // qax@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14264 signed int v62; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14265 signed int v63; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14266 int v64; // eax@87
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14267 unsigned int v65; // ebx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14268 char *v66; // edx@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14269 unsigned __int16 *v67; // esi@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14270 int v68; // edi@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14271 unsigned __int16 v69; // cx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14272 unsigned int v70; // [sp-10h] [bp-48074h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14273 unsigned int v71; // [sp-Ch] [bp-48070h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14274 unsigned int v72; // [sp-8h] [bp-4806Ch]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14275 signed int v73; // [sp-4h] [bp-48068h]@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14276 unsigned __int16 v74; // [sp-4h] [bp-48068h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14277 char v75; // [sp+Ch] [bp-48058h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14278 int v76; // [sp+4800Ch] [bp-58h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14279 unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14280 unsigned __int16 *v78; // [sp+48014h] [bp-50h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14281 unsigned int v79; // [sp+48018h] [bp-4Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14282 unsigned int y_; // [sp+4801Ch] [bp-48h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14283 int v81; // [sp+48020h] [bp-44h]@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14284 unsigned int x_; // [sp+48024h] [bp-40h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14285 unsigned int teal; // [sp+48028h] [bp-3Ch]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14286 int v84; // [sp+4802Ch] [bp-38h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14287 int v85; // [sp+48030h] [bp-34h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14288 int v86; // [sp+48034h] [bp-30h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14289 int v87; // [sp+48038h] [bp-2Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14290 unsigned int v88; // [sp+4803Ch] [bp-28h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14291 int black; // [sp+48040h] [bp-24h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14292 int v90; // [sp+48044h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14293 unsigned int i; // [sp+48048h] [bp-1Ch]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14294 unsigned int v92; // [sp+4804Ch] [bp-18h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14295 unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14296 unsigned int v94; // [sp+48054h] [bp-10h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14297 unsigned int v95; // [sp+48058h] [bp-Ch]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14298 int v96; // [sp+4805Ch] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14299 const void *v97; // [sp+48060h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14300 char *a4a; // [sp+4806Ch] [bp+8h]@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14301 int a5a; // [sp+48070h] [bp+Ch]@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14302
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14303 x_ = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14304 y_ = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14305 v85 = (signed int)(x + a4) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14306 v90 = (signed int)(y + a5) >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14307 v79 = pRenderer->uTargetSurfacePitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14308 pRenderer->Clip_v2(x, y, a4, a5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14309 v5 = viewparams->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14310 v6 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14311 v86 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14312 v84 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14313 if ( viewparams->field_2C != 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14315 if ( viewparams->field_2C == 768 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14317 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14318 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14319 v5 = 680;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14321 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14322 goto LABEL_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14323 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14324 v94 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14325 v92 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14326 v93 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14327 v95 = (unsigned int)pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14328 v78 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14329 v87 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14330 v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14331 black = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14332 teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14333 v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14334 v96 = 32768 - black - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14335 v31 = (signed __int64)((double)v96 / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14336 v32 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14337 v33 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14338 v34 = (int)v31 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14339 v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14340 black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14341 v76 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14342 v35 = v34 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14343 if ( v95 && (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14344 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14345 v96 = v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14346 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14347 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14348 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14349 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14351 v36 = v95 + v35 * v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14352 i = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14353 v88 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14354 v37 = black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14355 v77 = (unsigned __int16 *)v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14356 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14358 *(short *)v32 = v78[*((char *)v77 + v37)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14359 v32 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14360 v97 = (char *)v97 + v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14361 v37 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14362 --i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14363 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14364 while ( i );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14365 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14366 v34 += v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14367 v97 = (const void *)teal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14368 black = v81;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14369 v32 += 2 * (v94 - v88);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14370 v35 = v34 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14371 --v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14373 while ( v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14374 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14375 v97 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14376 if ( (signed int)v92 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14377 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14378 v96 = v92;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14379 v38 = 2 * (v79 - v94);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14380 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14382 if ( (signed int)v94 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14383 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14384 v39 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14385 v40 = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14386 v41 = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14387 v42 = v94 & 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14388 v43 = v94 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14389 memcpy(v93, v97, 4 * (v94 >> 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14390 v45 = (int)((char *)v40 + 4 * v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14391 v44 = (int)&v41[2 * v43];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14392 v46 = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14393 v39 *= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14394 v93 = (unsigned __int16 *)((char *)v93 + v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14395 v97 = (char *)v97 + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14396 while ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14398 *(short *)v44 = *(short *)v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14399 v45 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14400 v44 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14401 --v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14402 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14403 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14405 v93 = (unsigned __int16 *)((char *)v93 + v38);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14406 --v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14408 while ( v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14410 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14412 v6 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14413 v86 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14414 v84 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14415 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14416 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14417 v5 = viewparams->field_2C - 34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14418 LABEL_8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14419 black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14420 teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu);
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14421 v7 = (uint *)pIndoor->pMapOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14422 uNumBlueFacesInBLVMinimap = 0;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14423 v8 = pIndoor->pMapOutlines->uNumOutlines == 0;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14424 v9 = (pIndoor->pMapOutlines->uNumOutlines & 0x80000000u) != 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14425 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14426 if ( !(v9 | v8) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14428 i = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14429 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14431 v10 = (int)((char *)v7 + i + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14432 v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14433 if ( BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14434 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14435 v12 = *(short *)((char *)v7 + i + 14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14436 if ( !(v12 & 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14437 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14438 if ( !(v96 & 0x80) && (v11 & 0x80u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14439 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14440 v96 = (signed int)v94 >> 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14441 v13 = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14442 *(short *)(v10 + 10) = v12 | 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14443 pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14445 v14 = *(short *)v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14446 v88 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14447 v15 = &pIndoor->pVertices[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14448 v16 = v15->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14449 v17 = v15->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14450 v93 = (unsigned __int16 *)(v16 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14451 v92 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14452 v18 = &pIndoor->pVertices[*(short *)(v10 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14453 v19 = v18->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14454 v20 = v18->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14455 v95 = v19 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14456 v97 = (const void *)v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14457 v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14458 v87 = (unsigned __int64)((signed int)v92 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14459 v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14460 v92 = (unsigned __int64)(v20 * (signed __int64)v5) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14461 pRenderer->Line2D(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14462 v85 + v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14463 v90 - v87,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14464 v85 + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14465 v90 - v92,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14466 black);
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14467 v7 = (uint *)pIndoor->pMapOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14468 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14469 ++v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14470 i += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14471 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14472 while ( (signed int)v94 < (signed int)*v7 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14474 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14475 if ( (signed int)uNumBlueFacesInBLVMinimap > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14476 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14477 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14479 v22 = pBlueFacesInBLVMinimapIDs[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14480 v87 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14481 v23 = (int)&v7[3 * v22 + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14482 v24 = &pIndoor->pVertices[*(short *)v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14483 v25 = &pIndoor->pVertices[*(short *)(v23 + 2)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14484 v26 = v25->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14485 v27 = (unsigned __int16 *)(v24->x - v86);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14486 v28 = v24->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14487 v29 = v25->y - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14488 v93 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14489 v92 = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14490 v97 = (const void *)v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14491 v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14492 v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14493 i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14494 v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14495 pRenderer->Line2D(
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14496 v85 + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14497 v90 - v88,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14498 v85 + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14499 v90 - v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14500 teal);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14501 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14502 if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14503 break;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14504 v7 = (uint *)pIndoor->pMapOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14506 v6 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14508 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14509 v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85 - 3;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14510 v81 = pParty->vPosition.y - v84;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14511 v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14512 v48 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14513 v49 = v90 - (int)v97 - 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14514 if ( v47 >= (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14515 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14516 if ( v47 > (signed int)a4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14517 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14518 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
14519 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14520 v47 = a4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14523 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14525 if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + v85) < (signed int)x_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14526 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14527 v47 = x_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14528 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14529 if ( v49 >= (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14530 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14531 if ( v49 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14533 if ( v90 - (signed int)v97 - 6 > a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14534 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14535 v49 = a5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14536 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14538 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14540 if ( v90 - (signed int)v97 < (signed int)y_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14541 v48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14542 v49 = y_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14544 if ( v48 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14545 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14546 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14547 v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14548 if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14550 if ( (signed int)v51 > 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14552 if ( (signed int)v51 >= 640 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14554 if ( (signed int)v51 > 896 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14556 if ( (signed int)v51 >= 1152 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14557 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14558 if ( (signed int)v51 > 1408 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14560 if ( (signed int)v51 >= 1664 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14561 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14562 if ( (signed int)v51 > 1920 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14563 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14564 v73 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14566 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14568 v73 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14569 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14571 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14573 v73 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14574 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14576 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14578 v73 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14579 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14580 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14581 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14583 v73 = 3;
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 v73 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14590 v50 = v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14591 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14593 v50 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14594 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14595 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14596 pRenderer->_4A6776(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14597 v47,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14598 v49,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14599 (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14601 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14602 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14603 v86 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14604 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14606 v94 = (unsigned int)&pLevelDecorations[0].vPosition;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14607 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14609 if ( *(char *)(v94 - 2) & 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14611 v53 = *(int *)(v94 + 4) - v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14612 v93 = (unsigned __int16 *)(*(int *)v94 - v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14613 v92 = v53;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14614 v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14615 v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14616 v55 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14617 if ( v54 >= pRenderer->field_1C_clipx )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14619 if ( v54 <= pRenderer->field_24_clipz && v55 >= pRenderer->field_20_clipy && v55 <= pRenderer->field_28_clipw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14621 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14622 if ( v5 > 512 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14623 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14624 v96 = v55 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14625 black = v55 - 1;
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14626 pRenderer->Line2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86);
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14627 pRenderer->Line2D(v54, black, v54, v96, v86);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14628 ++v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14629 v74 = v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14630 v72 = v96;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14631 v71 = v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14632 v70 = black;
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 v72 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14637 v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14638 v70 = v90 - (int)v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14639 }
52
0f4ed4f0f472 BLV minimap: 1/3
Nomad
parents: 51
diff changeset
14640 pRenderer->Line2D(v54, v70, v71, v72, v74);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14641 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14644 ++v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14645 result = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14646 v94 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14648 while ( (signed int)v95 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14650 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14652 v90 = a4 - x_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14653 v95 = a5 - y_ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14654 v77 = &pRenderer->pTargetSurface[x_ + y_ * v79];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14655 v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14656 black = (1 << (v56 + 16)) / v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14657 v57 = (double)(1 << (16 - v56));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14658 v58 = 22528 / (v5 / 384);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14659 v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14660 v60 = (int)v59 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14661 v97 = (const void *)((int)v59 << 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14662 v61 = (signed __int64)((double)(32768 - v58 - v84) / v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14663 v78 = (unsigned __int16 *)(v60 >> 16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14664 v62 = (int)v61 << 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14665 teal = v60 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14666 v63 = (signed __int16)v61;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14667 a4a = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14668 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14669 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14670 for ( i = result; v85 < (signed int)v95; result = v85 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14672 a5a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14673 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14675 v96 = (v63 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14676 v64 = teal;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14677 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14678 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14679 v81 = (v64 - 80) / 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14680 if ( !pOutdoor->_47F04C(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14681 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14682 if ( pOutdoor->_47F097(v81, v96) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14683 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14684 if ( !((a5a + v85) % 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14685 *(short *)a4a = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14687 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14689 *(short *)a4a = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14692 a4a += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14693 v97 = (char *)v97 + black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14694 v64 = (signed int)v97 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14695 ++a5a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14697 while ( a5a < v90 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14699 v62 += black;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14700 v97 = (const void *)v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14701 a4a += 2 * (v90 - a5a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14702 v63 = v62 >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14703 ++v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14704 teal = (unsigned int)v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14705 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14706 v65 = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14707 v66 = &v75;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14708 if ( (signed int)v95 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14710 v67 = v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14711 result = 2 * (v79 - v90);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14712 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14714 if ( v90 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14716 v68 = v90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14717 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14718 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14719 v69 = *(short *)v66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14720 if ( !*(short *)v66 || v69 == (short)i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14721 *v67 = v69;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14722 v66 += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14723 ++v67;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14724 --v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14726 while ( v68 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14728 v67 = (unsigned __int16 *)((char *)v67 + result);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14729 --v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14731 while ( v65 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14734 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14736
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14737 //----- (00443219) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14738 int ViewingParams::_443219()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14740 this->sPartyPosZ += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14741 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14743
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14744 //----- (00443225) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14745 int ViewingParams::_443225()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14746 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14747 this->sPartyPosX -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14748 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14750
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14751 //----- (00443231) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14752 int ViewingParams::_443231()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14754 this->sPartyPosZ -= 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14755 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14756 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14757
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14758 //----- (0044323D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14759 int ViewingParams::_44323D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14761 this->sPartyPosX += 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14762 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14764
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14765 //----- (00443249) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14766 int ViewingParams::_443249()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14767 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14768 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14769
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14770 v1 = (unsigned __int64)((signed __int64)this->field_2C << 15) >> 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14771 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14772 if ( v1 < 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14773 this->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14774 this->sPartyPosX = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14775 this->sPartyPosZ = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14776 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14778
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14779 //----- (00443291) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14780 int ViewingParams::_443291()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14782 int v1; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14783 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14784
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14785 v1 = 2 * this->field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14786 v2 = 1536;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14787 this->field_2C = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14788 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14789 v2 = 3072;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14790 if ( v1 > v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14791 this->field_2C = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14792 this->sPartyPosX = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
14793 this->sPartyPosZ = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14794 return _4432E7();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14795 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14796
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14797 //----- (004432E7) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14798 int ViewingParams::_4432E7()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14800 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14801 int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14802 signed int v3; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14803 int v4; // ecx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14804 int v5; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14805 int v6; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14806 int v7; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14807 int result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14808
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14809 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14810 v2 = this->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14811 v3 = 88 >> this->field_2C / 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14812 v4 = (44 - v3) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14813 if ( v1->sPartyPosZ > v2 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14814 v1->sPartyPosZ = v2 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14815 v5 = v1->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14816 v6 = (v3 - 44) << 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14817 if ( v1->sPartyPosX < v5 + v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14818 v1->sPartyPosX = v5 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14819 v7 = v2 + v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14820 if ( v1->sPartyPosZ < v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14821 v1->sPartyPosZ = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14822 result = v5 + v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14823 if ( v1->sPartyPosX > v5 + v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14824 v1->sPartyPosX = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14825 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14827
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14828 //----- (00443343) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14829 unsigned int ViewingParams::_443343()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14830 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14831 signed int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14832 unsigned __int16 *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14833 unsigned int result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14834
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14835 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14836 v2 = this->pPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14837 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14839 result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14840 *v2 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14841 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14842 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14844 while ( v1 < 256 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14845 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14846 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14847
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14848 //----- (00443365) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14849 int ViewingParams::_443365()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14850 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14851 ViewingParams *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14852 __int16 *v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14853 Vec3_short_ *v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14854 unsigned int v4; // edx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14855 signed int v5; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14856 Vec3_short_ *v6; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14857 signed int v7; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14858 signed int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14859 char v9; // zf@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14860 int result; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14861 unsigned int v11; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14862 unsigned int *v12; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14863 unsigned int v13; // [sp+Ch] [bp-14h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14864 unsigned int v14; // [sp+10h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14865 unsigned int v15; // [sp+14h] [bp-Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14866 unsigned int v16; // [sp+18h] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14867 unsigned int v17; // [sp+1Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14868
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14869 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14870 _443343();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14871 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14873 v16 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14874 v14 = 0x40000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14875 v17 = 0xC0000000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14876 v15 = 0xC0000000u;
53
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14877 if ( (signed int)pIndoor->pMapOutlines->uNumOutlines > 0 )
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14878 {
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14879 v2 = (__int16 *)(pIndoor->pMapOutlines->pOutlines);
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14880 v11 = pIndoor->pMapOutlines->uNumOutlines;
fd2fd234a66c BLV minimap: 2/3
Nomad
parents: 52
diff changeset
14881 v12 = (uint *)pIndoor->pMapOutlines->pOutlines;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14882 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14883 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14884 v3 = &pIndoor->pVertices[*v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14885 v4 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14886 if ( (signed int)v4 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14887 v16 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14888 if ( (signed int)v4 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14889 v17 = v3->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14890 v5 = v3->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14891 v13 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14892 if ( v5 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14893 v14 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14894 if ( v5 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14895 v15 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14896 v6 = &pIndoor->pVertices[v2[1]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14897 v7 = v6->x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14898 if ( v7 < (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14899 v16 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14900 if ( v7 > (signed int)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14901 v17 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14902 v8 = v6->y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14903 if ( v8 < (signed int)v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14904 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14905 if ( v8 > (signed int)v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14906 v15 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14907 v2 = (__int16 *)(v12 + 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14908 v9 = v11-- == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14909 v12 += 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14910 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14911 while ( !v9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14912 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14913 v1->uMinimapZoom = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14914 v1->field_38 = (signed int)(v16 + v17) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14915 v1->field_28 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14916 result = (signed int)(v14 + v15) / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14917 v1->field_3A = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14918 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14919 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14920 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14921 v1->field_38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14922 v1->field_3A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14923 v1->uMinimapZoom = dword_576E2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14924 result = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14925 v1->field_28 = dword_576E28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14926 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14927 v1->field_2C = 384;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14928 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14929 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14930
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14931
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14932 //----- (00443801) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14933 int __cdecl Initialize2DA()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14934 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14935 const char *v0; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14936 _2devent *v1; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14937 char *v2; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14938 int v3; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14939 char v4; // cl@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14940 int v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14941 int v6; // ebx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14942 int v7; // eax@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14943 int result; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14944 signed int v9; // [sp+10h] [bp-8h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14945 signed int v10; // [sp+14h] [bp-4h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14946
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14947 int it = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14948
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14949 if ( p2DEventsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14950 pAllocator->FreeChunk(p2DEventsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14951 p2DEventsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14952 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14953 p2DEventsTXT_Raw = (char *)pEvents_LOD->LoadRaw("2dEvents.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14954 strtok(p2DEventsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14955 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14956 v1 = p2DEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14957 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14959 v2 = strtok(0, v0) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14960 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14961 v3 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14962 v9 = -2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14963 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14964 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14965 v4 = *v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14966 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14967 while ( v4 != 9 && v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14969 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14970 v4 = v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14972 v6 = (int)&v2[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14973 if ( !v2[v5] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14974 v10 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14975 *(char *)v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14976 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14978 switch ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14979 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14980 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14981 if ( _strnicmp(v2, "wea", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14982 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14983 if ( _strnicmp(v2, "arm", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14984 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14985 if ( _strnicmp(v2, "mag", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14987 if ( _strnicmp(v2, "alc", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14989 if ( _strnicmp(v2, "sta", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14991 if ( _strnicmp(v2, "boa", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14993 if ( _strnicmp(v2, "tem", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14994 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14995 if ( _strnicmp(v2, "tra", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14996 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14997 if ( _strnicmp(v2, "tow", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14998 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14999 if ( _strnicmp(v2, "tav", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15000 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15001 if ( _strnicmp(v2, "ban", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15003 if ( _strnicmp(v2, "fir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15005 if ( _strnicmp(v2, "air", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15007 if ( _strnicmp(v2, "wat", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15009 if ( _strnicmp(v2, "ear", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15011 if ( _strnicmp(v2, "spi", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15012 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15013 if ( _strnicmp(v2, "min", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15015 if ( _strnicmp(v2, "bod", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15017 if ( _strnicmp(v2, "lig", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15019 if ( _strnicmp(v2, "dar", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15020 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15021 if ( _strnicmp(v2, "ele", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15023 if ( _strnicmp(v2, "sel", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15025 if ( _strnicmp(v2, "mir", 3u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15026 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15027 v7 = -(_strnicmp(v2, "mer", 3u) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15028 LOBYTE(v7) = v7 & 0xEE;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15029 v1->uType = v7 + 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15030 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15031 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15033 v1->uType = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15034 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15035 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15036 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15037 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15038 v1->uType = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15041 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15042 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15043 v1->uType = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15046 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15047 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15048 v1->uType = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15051 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15053 v1->uType = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15056 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15058 v1->uType = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15059 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15061 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15063 v1->uType = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15065 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15066 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15067 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15068 v1->uType = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15069 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15070 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15071 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15072 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15073 v1->uType = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15074 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15075 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15076 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15077 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15078 v1->uType = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15079 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15081 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15082 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15083 v1->uType = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15084 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15086 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15087 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15088 v1->uType = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15089 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15090 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15091 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15092 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15093 v1->uType = 22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15095 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15096 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15097 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15098 v1->uType = 21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15099 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15100 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15101 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15103 v1->uType = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15106 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15108 v1->uType = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15109 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15111 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15113 v1->uType = 23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15116 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15118 v1->uType = 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15120 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15121 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15122 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15123 v1->uType = 27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15126 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15128 v1->uType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15129 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15131 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15133 v1->uType = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15136 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15138 v1->uType = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15141 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15143 v1->uType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15145 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15146 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15147 v1->uAnimationID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15148 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15149 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15150 v1->pName = (char *)RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15151 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15152 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15153 v1->pProprieterName = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15154 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15155 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15156 v1->pProprieterTitle = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15157 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15158 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15159 v1->field_14 = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15160 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15161 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15162 v1->_state = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15163 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15164 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15165 v1->_rep = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15166 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15167 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15168 v1->_per = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15169 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15170 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15171 v1->fPriceMultiplier = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15172 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15173 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15174 v1->flt_24 = atof(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15175 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15176 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15177 v1->field_1C = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15178 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15179 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15180 v1->uOpenTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15181 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15182 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15183 v1->uCloseTime = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15184 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15185 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15186 v1->uExitPicID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15187 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15188 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15189 v1->uExitMapID = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15190 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15191 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15192 v1->_quest_related = atoi(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15193 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15194 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15195 v1->pEnterText = RemoveQuotes(v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15196 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15197 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15198 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15201 v2 = (char *)(v6 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15202 v3 = v9 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15203 v9 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15204 result = v3 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15206 while ( v3 + 1 <= 23 && !v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15207 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15208 //if ( (signed int)v1 >= (signed int)&unk_597F10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15209 if (++it >= 525)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15210 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15211 v0 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15215 //----- (00443CE1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15216 unsigned int __fastcall LoadEventsToBuffer(const char *pContainerName, char *a2, unsigned int uBufferSize)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15218 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15219 FILE *v4; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15220 unsigned int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15221 char Args; // [sp+8h] [bp-B4h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15222 //Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15223 void *Dst; // [sp+B4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15224 void *ptr; // [sp+B8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15225
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15226 v3 = pContainerName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15227 Dst = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15228 ptr = pEvents_LOD->LoadRaw(pContainerName, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15230 Texture DstBuf; // [sp+6Ch] [bp-50h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15231 //Texture::Texture(&DstBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15233 v4 = pEvents_LOD->FindContainer(v3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15234 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15235 Abortf("Unable to load %s", v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15236 fread(&DstBuf, 1u, 0x30u, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15237 v5 = DstBuf.uDecompressedSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15238 if ( !DstBuf.uDecompressedSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15239 v5 = DstBuf.uTextureSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15240 memset(&DstBuf, 0, 0x48u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15241 if ( (signed int)v5 >= (signed int)uBufferSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15243 sprintfex(&Args, "File %s Size %lu - Buffer size %lu", v3, v5, uBufferSize);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15244 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15246 memcpy(Dst, ptr, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15247 pAllocator->FreeChunk(ptr);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15248 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15249 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15250
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15251 //----- (00443DA1) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15252 void __cdecl Initialize_GlobalEVT()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15254 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15255 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15256 char *v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15257
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15258 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15259 uGlobalEVT_Size = LoadEventsToBuffer("global.evt", pGlobalEVT, 0xB400u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15260 if ( uGlobalEVT_Size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15261 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15262 uGlobalEVT_NumEvents = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15263 memset(pGlobalEVT_Events, 128, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15264 v1 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15265 v2 = (char *)&pGlobalEVT_Events[uGlobalEVT_NumEvents].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15266 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15268 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15269 *((int *)v2 - 1) = (unsigned __int8)pGlobalEVT[v0 + 1] + ((unsigned __int8)pGlobalEVT[v0 + 2] << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15270 *(int *)v2 = (unsigned __int8)pGlobalEVT[v0 + 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15271 *((int *)v2 + 1) = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15272 v2 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15273 v0 += (unsigned __int8)pGlobalEVT[v0] + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15274 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15275 while ( v0 < (signed int)uGlobalEVT_Size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15276 uGlobalEVT_NumEvents = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15279
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15280 //----- (00443E31) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15281 void __cdecl LoadLevel_InitializeLevelStr()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15283 signed __int16 v0; // si@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15284 //unsigned int v1; // ecx@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15285 signed int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15286 int v3; // edx@1
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15287 //int v4; // eax@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15288 int v5; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15289 int v6; // ebx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15290 int v7; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15291 unsigned int *v8; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15292 char Args[100]; // [sp+Ch] [bp-68h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15293 int v10; // [sp+70h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15294
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15295 if (sizeof(pLevelStrOffsets) != 0x7D0)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15296 Log::Warning(L"pLevelStrOffsets: deserialization warning");
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15297 memset(pLevelStrOffsets, 0, 0x7D0u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15298
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15299 v0 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15300 //v1 = uLevelStrFileSize;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15301 v2 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15302 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15303 v10 = 0;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15304 //v4 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15305 for (uint i = 0; i < uLevelStrFileSize; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15306 {
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15307 if ( !pLevelStr[i] )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15308 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15309 v5 = (signed __int16)v2++;
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15310 pLevelStrOffsets[v5] = i + 1;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15311 if ( (signed __int16)(i - (short)v10) > v0 )
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15312 v0 = i - v10;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15313 v10 = i;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15314 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15315 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15316
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15317 uLevelStrNumStrings = (signed __int16)v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15318 if ( v0 > 800 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15320 sprintfex(Args, "MAX_EVENT_TEXT_LENGTH needs to be increased to %lu", v0 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15321 Abortf(Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15322 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15323 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15324 if ( (signed __int16)v2 - 1 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15326 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15327 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15329 v8 = &pLevelStrOffsets[v7];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15330 if ( RemoveQuotes(&pLevelStr[*v8]) != &pLevelStr[*v8] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15331 ++*v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15332 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15333 v7 = (signed __int16)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15334 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15335 while ( (signed __int16)v6 < (signed int)uLevelStrNumStrings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15336 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15338
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15339 //----- (00443EF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15340 void __cdecl LoadLevel_InitializeLevelEvt()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15341 {
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15342 if (!uLevelEVT_Size)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15343 return;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15344
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15345 memset(array_5B5928, 0, 0xC80u);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15346 memset(pLevelEVT_Events, 128, 0xCE40u);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15347
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15348 uLevelEVT_NumEvents = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15349 dword_5B65C8 = 0;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15350
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15351 for (uint i = 0, j = 0; j < uLevelEVT_Size; ++i)
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15352 {
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15353 pLevelEVT_Events[i].uEventID = pLevelEVT[j + 1] + ((unsigned short)pLevelEVT[j + 2] << 8);
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15354 pLevelEVT_Events[i].field_4 = pLevelEVT[j + 3];
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15355 pLevelEVT_Events[i].uEventOffsetInEVT = j;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15356 j += pLevelEVT[j] + 1;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15357
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15358 uLevelEVT_NumEvents++;
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15359 }
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15360 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15361
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15362 //----- (00443F95) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15363 void __cdecl OnMapLeave()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15365 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15366 char *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15367 int v2; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15368
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15369 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15370 if ( (signed int)uLevelEVT_NumEvents > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15371 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15372 v1 = (char *)&pLevelEVT_Events[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15373 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15375 if ( pLevelEVT[*((short *)v1 + 2) + 4] == 53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15377 v2 = *((int *)v1 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15378 dword_597F18 = *(int *)v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15379 EventProcessor(v2, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15380 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15382 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15383 v1 += 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15385 while ( v0 < (signed int)uLevelEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15387 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15388
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15389
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15390 //----- (00443FDC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15391 void OnMapLoad()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15392 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15393 stru176 *v3; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15394 __int16 v4; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15395 __int16 v5; // di@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15396 int v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15397 signed __int64 v8; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15398 unsigned int v9; // ecx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15399 signed __int64 v10; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15400 signed __int64 v11; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15401 int v12; // ST50_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15402 signed __int64 v13; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15403 signed __int64 v14; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15404 int v15; // ST58_4@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15405 signed __int64 v16; // qax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15406 int v17; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15407 unsigned __int64 v18; // [sp+Ch] [bp-44h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15408 signed __int64 v19; // [sp+14h] [bp-3Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15409 unsigned __int64 v20; // [sp+1Ch] [bp-34h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15410 int v22; // [sp+2Ch] [bp-24h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15411 int v24; // [sp+34h] [bp-1Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15412 int v25; // [sp+38h] [bp-18h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15413 int v26; // [sp+3Ch] [bp-14h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15414 int v27; // [sp+3Ch] [bp-14h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15415 int v28; // [sp+40h] [bp-10h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15416 __int16 v29; // [sp+46h] [bp-Ah]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15417 __int16 v30; // [sp+48h] [bp-8h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15418 __int16 v31; // [sp+4Ah] [bp-6h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15419 __int16 v32; // [sp+4Ch] [bp-4h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15420 __int16 v33; // [sp+4Eh] [bp-2h]@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15421
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15422 for (uint i = 0; i < uLevelEVT_NumEvents; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15423 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15424 auto pEvent = pLevelEVT_Events + i;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15425
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15426 auto _evt = (_evt_raw *)(pLevelEVT + pEvent->uEventOffsetInEVT);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15427
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15428 if (_evt->v4 == 3)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15429 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15430 pSoundList->_4A9A67(
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15431 _evt->v5 +
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15432 ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15433 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15434 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15435 else if (_evt->v4 == 37)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15436 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15437 dword_597F18 = pEvent->field_4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15438 EventProcessor(pEvent->uEventID, 0, 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15439 dword_597F18 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15440 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15441 else if (_evt->v4 == 31 || _evt->v4 == 38)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15442 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15443 v3 = &array_5B5928[dword_5B65C8];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15444 v20 = pOutdoor->uLastVisitDay;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15445 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15446 v20 = pIndoor->stru1.uLastVisitDay;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15447
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15448 v4 = _evt->v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15449 v3->field_1C = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15450 v3->field_8 = pEvent->uEventID;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15451 v3->field_A = pEvent->field_4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15452 v33 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15453 v3->field_12 = v33;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15454 v32 = _evt->v7;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15455 v3->field_14 = v32;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15456 v31 = _evt->v8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15457 v3->field_16 = v31;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15458 v5 = _evt->v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15459 v30 = _evt->v9;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15460 v3->field_18 = v30;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15461 v29 = _evt->v10;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15462 v3->field_1A = v29;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15463
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15464 v6 = ((unsigned short)_evt->v12 << 8) + _evt->v11;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15465 v3->field_10 = v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15466 v3->field_C = v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15467 v3->field_E = v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15468 if ( v4 == 38 && !(short)v6 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15469 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15470 if ( v20 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15471 v18 = pParty->uTimePlayed - v20;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15472 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15473 v18 = 0i64;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15474 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
15475
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15476 if ( v26 / 7 / 4 / 12 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15477 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15478 if ( v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15479 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15480 v3->field_4 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15481 ++dword_5B65C8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15482 v3->field_0 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15483 continue;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15484 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15485 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15486 if (v26 / 7 / 4 != 0 && v33 != 0 ||
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15487 v26 / 7 != 0 && v32 != 0 ||
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15488 v26 != 0 || !v20)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15489 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15490 v3->field_4 = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15491 ++dword_5B65C8;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15492 v3->field_0 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15493 continue;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15494 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15495 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15496
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15497 v8 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15498 v9 = v8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15499 v10 = (signed int)v8 / 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15500 v22 = v10 % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15501 v11 = (signed int)(v10 / 60);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15502 v12 = v11 % 24;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15503 v13 = (signed int)(v11 / 24);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15504 v27 = v13 % 7;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15505 v14 = (signed int)(v13 / 7);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15506 v15 = v14 % 4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15507 v16 = (signed int)(v14 / 4);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15508 v24 = v16 / 12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15509
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15510 auto _1 = (unsigned __int64)((double)pParty->uTimePlayed * 0.234375) >> 32;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15511 auto _2 = ((__int64)v9 << 32) | _1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15512
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15513 v19 = _2 % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15514 //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
15515 // v9)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15516 // % 60;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15517
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15518 v17 = v12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15519 v25 = v15;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15520 v28 = v16 % 12;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15521 if ( v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15522 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15523 ++v24;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15524 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15525 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15526 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15527 if ( v33 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15528 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15529 ++v28;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15531 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15532 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15533 if ( v32 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15534 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15535 ++v25;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15536 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15537 else
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15538 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15539 ++v27;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15540 v22 = v30;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15541 v17 = v31;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15542 v19 = v29;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15543 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15544 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15545 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15546 auto v0 = (signed __int64)((double)((v19
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15547 + 0x3C * v22
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15548 + 0xE10 * v17
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15549 + 0x93A80 * v25
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15550 + 0x15180 * v27
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15551 + 0x24EA00 * (v28 + 12i64 * v24)) << 7)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15552 * 0.033333335);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15553 v3->field_4 = HIDWORD(v0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15554
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15555 ++dword_5B65C8;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
15556 v3->field_0 = v0;
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 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15560
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15561 //----- (00444360) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15562 void __thiscall Level_LoadEvtAndStr(const char *pLevelName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15564 char pContainerName[120]; // [sp+8h] [bp-98h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15565
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15566 sprintf(pContainerName, "%s.evt", pLevelName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15567 uLevelEVT_Size = LoadEventsToBuffer(pContainerName, pLevelEVT, 0x2400u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15568
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15569 sprintf(pContainerName, "%s.str", pLevelName);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15570 uLevelStrFileSize = LoadEventsToBuffer(pContainerName, pLevelStr, 0x2400u);
28
18f7a1b94448 Indoor::Load
Nomad
parents: 27
diff changeset
15571 if (uLevelStrFileSize)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15572 LoadLevel_InitializeLevelStr();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15574
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15575 //----- (004443D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15576 char *__cdecl _4443D5_GetMinimapRightClickText()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15577 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15578 int v0; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15579 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15580 signed int v2; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15581 double v3; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15582 int v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15583 int v5; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15584 int v6; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15585 int v7; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15586 BSPModel *v8; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15587 unsigned __int8 v9; // zf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15588 char v10; // sf@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15589 unsigned __int8 v11; // of@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15590 ODMFace *v12; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15591 __int16 v13; // cx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15592 const char *v14; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15593 const char *v15; // edi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15594 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15595 unsigned int v17; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15596 unsigned int v18; // [sp+Ch] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15597 int v19; // [sp+10h] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15598 int v20; // [sp+14h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15599 char *v21; // [sp+18h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15600 unsigned int pY; // [sp+1Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15601 int v23; // [sp+20h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15602 int v24; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15603 int pX; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15605 v24 = pParty->vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
15606 v0 = pParty->vPosition.y;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15607 v1 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15608 *(float *)&v23 = (double)(signed int)viewparams->uMinimapZoom * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15609 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15610 v18 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15611 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15612 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15613 v3 = 1.0 / *(float *)&v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15614 v23 = pX - 557;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15615 v19 = (signed __int64)((double)(pX - 557) * v3 + (double)v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15616 v20 = (signed __int64)((double)v0 - (double)(signed int)(pY - 74) * v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15617 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || (*(float *)&v23 = 0.0, (signed int)v1 <= 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15619 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15620 v17 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15621 if ( v17 == v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15622 result = "No Maze Info for this maze on file!";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15623 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15624 result = pMapStats->pInfos[v17].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15625 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15626 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15628 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15629 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15631 pX = pOutdoor->pBModels[v4].vBoundingCenter.x - v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15632 pY = pOutdoor->pBModels[v4].vBoundingCenter.y - v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15633 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15634 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15635 v7 = sub_4621DA(v6, v5, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15636 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15637 if ( v7 < 2 * pOutdoor->pBModels[v4].sBoundingRadius )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15638 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15639 v11 = __OFSUB__(pOutdoor->pBModels[v4].uNumFaces, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15640 v9 = pOutdoor->pBModels[v4].uNumFaces == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15641 v10 = ((pOutdoor->pBModels[v4].uNumFaces - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15642 v24 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15643 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15645 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15646 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15647 v12 = &v8[v4].pFaces[v2 / 0x134u];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15648 v13 = v12->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15649 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15650 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15651 if ( !(BYTE2(v12->uAttributes) & 0x10) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15653 v14 = _444732_GetEventHintString(v13);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15654 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15655 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15656 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15657 if ( _strcmpi(v14, "") )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15658 v21 = (char *)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15659 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15660 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15662 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15663 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15664 v2 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15665 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15666 while ( v24 < (signed int)pOutdoor->pBModels[v4].uNumFaces );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15668 result = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15669 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15670 if ( v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15671 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15672 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15673 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15674 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15675 if ( v23 >= (signed int)v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15676 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15679 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15681
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15682 //----- (00444564) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15683 const char *__cdecl sub_444564()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15684 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15685 double v0; // st7@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15686 int v1; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15687 int v2; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15688 int v3; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15689 int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15690 int v5; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15691 int v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15692 int v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15693 BSPModel *v8; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15694 unsigned __int8 v9; // zf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15695 unsigned __int8 v10; // sf@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15696 ODMFace *v11; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15697 __int16 v12; // cx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15698 const char *v13; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15699 const char *v14; // edi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15700 const char *result; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15701 unsigned int v16; // [sp+0h] [bp-20h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15702 const char *v17; // [sp+4h] [bp-1Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15703 unsigned int pY; // [sp+8h] [bp-18h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15704 float v19; // [sp+Ch] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15705 int v20; // [sp+10h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15706 int v21; // [sp+14h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15707 unsigned int v22; // [sp+18h] [bp-8h]@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15708 int pX; // [sp+1Ch] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15709
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15710 v20 = viewparams->sPartyPosX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15711 v21 = viewparams->sPartyPosZ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15712 v19 = (double)viewparams->field_2C * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15713 if ( viewparams->field_2C == 384 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15714 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15715 v20 = viewparams->field_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15716 v21 = viewparams->field_3A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15718 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15719 v16 = pOutdoor->uNumBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15720 pMouse->GetClickPos((unsigned int *)&pX, &pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15721 v0 = 1.0 / v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15722 v1 = (signed __int64)((double)(pX - 229) * v0 + (double)v20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15723 LODWORD(v19) = (signed __int64)((double)v21 - (double)(signed int)(pY - 181) * v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15724 v2 = abs(v1 + 22528) / 512;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15725 v3 = abs((signed)LODWORD(v19) - 22528);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15726 if ( pOutdoor->_47F04C(v2, v3 / 512)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15727 && uCurrentlyLoadedLevelType == LEVEL_Outdoor
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15728 && (v4 = 0, v20 = 0, (signed int)v16 > 0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15730 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15731 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15732 pX = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.x + v4) - v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15733 pY = *(int *)((char *)&pOutdoor->pBModels->vBoundingCenter.y + v4) - LODWORD(v19);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15734 v5 = abs((signed)pY);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15735 v6 = abs((signed)pX);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15736 v7 = sub_4621DA(v6, v5, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15737 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15738 if ( v7 < *(int *)((char *)&pOutdoor->pBModels->sBoundingRadius + v4) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15740 v9 = *(unsigned int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15741 v10 = *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15742 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15743 if ( !(v10 | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15745 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15746 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15747 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15748 v11 = &(*(ODMFace **)((char *)&v8->pFaces + v4))[v22 / 0x134];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15749 v12 = v11->sCogTriggeredID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15750 if ( v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15751 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15752 if ( !(BYTE2(v11->uAttributes) & 0x10) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15753 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15754 v13 = _444732_GetEventHintString(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15755 v14 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15756 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15757 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15758 if ( _strcmpi(v13, "") )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15759 v17 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15761 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15763 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15764 v8 = pOutdoor->pBModels;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15765 v22 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15766 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15767 while ( v21 < *(signed int *)((char *)&pOutdoor->pBModels->uNumFaces + v4) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15769 result = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15770 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15771 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15772 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15773 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15774 v4 += 188;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15775 if ( v20 >= (signed int)v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15776 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15778 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15779 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15781 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15782 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15783 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15784 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15786
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15787
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15788
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15789
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15790 //----- (00444A51) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15791 char *__cdecl TransitionUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15793 MapInfo *v0; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15794 char *v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15795 char *result; // eax@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15796 std::string v3; // [sp-18h] [bp-84h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15797 unsigned int v4; // [sp-10h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15798 int v5; // [sp-Ch] [bp-78h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15799 const char *v6; // [sp-8h] [bp-74h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15800 signed int v7; // [sp-4h] [bp-70h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15801 GUIWindow v8; // [sp+Ch] [bp-60h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15802 unsigned int v9; // [sp+60h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15803 unsigned int v10; // [sp+64h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15804 int a3; // [sp+6Bh] [bp-1h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15805
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15806 memcpy(&v8, pGUIWindow0, sizeof(v8));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15807 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15808 v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15809 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15810 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15811 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15812 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15813 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15814 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15815 uTextureID_507B04 = uTextureID_right_panel;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15816 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15817 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15818 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15819 (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15820 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15821 0x22Cu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15822 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15823 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15824 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15825 0x1DCu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15826 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15827 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15828 if ( (pVideoPlayer->AnyMovieLoaded() || v9) && *dword_591164_teleport_map_name != 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15829 v10 = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15830 v0 = &pMapStats->pInfos[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15831 v8.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15832 v8.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15833 v8.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15834 v8.DrawText2(pFontCreate, 0, 5u, 0, v0->pName, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15835 v8.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15836 v8.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15837 v8.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15838 if ( uCurrentHouse_Animation )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15840 v1 = (&off_4EB080)[4 * uCurrentHouse_Animation];
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 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15845 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15846 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[409], v0->pName);// "Do you wish to leave %s?"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15847 v1 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15848 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15849 }
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15850 v1 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15851 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15852 if ( !v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15853 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15854 MessageBoxW(nullptr, L"No transition text found!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1410", 0);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
15855 v1 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15857 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15858 v7 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15859 v6 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15860 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15861 v4 = (212 - pFontCreate->CalcTextHeight(v1, &v8, 0, 0)) / 2 + 101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15862 result = v8.DrawText2(pFontCreate, 0, v4, v5, v6, v7);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15863 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15864 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15866
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15867
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15868 //----- (00444C8F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15869 GUIWindow *__cdecl UI_CreateTravelDialogue()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15871 signed int v0; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15872 unsigned int v1; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15873 GUIWindow *result; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15874 const char *v3; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15875 char pContainer[32]; // [sp+0h] [bp-28h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15876
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15877 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15878 v0 = const_2();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15879 sprintfex(pContainer, "evt%02d", v0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15880 if ( pParty->uAlignment )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15881 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15882 if ( pParty->uAlignment != 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15883 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15884 v3 = "-c";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15885 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15886 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15887 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15888 v3 = "-b";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15889 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15890 strcat(pContainer, v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15891 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15892 pTexture_Dialogue_Background = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15893 pTexture_outside = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("outside", TEXTURE_16BIT_PALETTE)];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15894 v1 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15895 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15896 sprintfex(byte_591098, pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15897 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15898 strcpy(byte_591098, pGlobalTXT_LocalizationStrings[79]);// "Exit"
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
15899 result = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)17, 0, (int)byte_591098);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15900 pDialogueWindow = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15901 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15903
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15904 //----- (00444D80) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15905 signed int __cdecl GetTravelTime()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15906 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15907 signed int v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15908
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15909 v0 = uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15910 if ( CheckHiredNPCSpeciality(5u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15911 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15912 if ( CheckHiredNPCSpeciality(6u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15913 v0 -= 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15914 if ( CheckHiredNPCSpeciality(7u) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15915 v0 -= 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15916 if ( CheckHiredNPCSpeciality(0x2Cu) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15917 --v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15918 if ( v0 < 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15919 v0 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15920 return v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15921 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15922 // 6BD07C: using guessed type int uDefaultTravelTime_ByFoot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15923
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15924 //----- (00444DCA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15925 void __cdecl TravelUI_Draw()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15927 unsigned int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15928 MapInfo *v1; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15929 char *v2; // ST14_4@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15930 signed int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15931 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15932 const char *v5; // [sp-Ch] [bp-90h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15933 signed int v6; // [sp-8h] [bp-8Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15934 GUIWindow v7; // [sp+Ch] [bp-78h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15935 char pDestinationMapName[32]; // [sp+60h] [bp-24h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15936 unsigned int v9; // [sp+80h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15937
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15938 memcpy(&v7, pGUIWindow0, sizeof(v7));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15939 v9 = pMapStats->GetMapInfo(pCurrentMapName);
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
15940 pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15941 v0 = pMapStats->GetMapInfo(pDestinationMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15942 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15943 pRenderer->DrawTextureTransparent(0x1D4u, 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15944 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15945 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pTexture_outside);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15946 pRenderer->DrawTextureIndexed(0x22Cu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15947 (Texture *)(uTextureID_x_x_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_x_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15948 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C3u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15949 (Texture *)(uTextureID_x_ok_u != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_x_ok_u] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15950 if ( v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15952 v1 = &pMapStats->pInfos[v0];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15953 v7.uFrameX = 493;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15954 v7.uFrameWidth = 126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15955 v2 = v1->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15956 v7.uFrameZ = 366;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15957 v7.DrawText2(pFontCreate, 0, 4u, 0, v2, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15958 v7.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15959 v7.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15960 v7.uFrameZ = 334;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15961 v3 = GetTravelTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15962 if ( v3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15963 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15964 v6 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15965 v5 = pGlobalTXT_LocalizationStrings[663]; // "It will take %d day to cross to %s."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15967 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15969 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15970 v5 = pGlobalTXT_LocalizationStrings[128]; // "It will take %d days to travel to %s."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15972 sprintfex(pTmpBuf, v5, v6, v1->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15973 strcat(pTmpBuf, "\n \n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15974 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[126], pMapStats->pInfos[v9].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15975 strcat(pTmpBuf, pTmpBuf2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15976 v4 = pFontCreate->CalcTextHeight(pTmpBuf, &v7, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15977 v7.DrawText2(pFontCreate, 0, (212 - v4) / 2 + 101, 0, pTmpBuf, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15978 dword_5B5924 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15979 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15981
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15982
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15983 //----- (00444FBE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15984 void __cdecl DrawBranchlessDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15985 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15986 GUIFont *v0; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15987 int v1; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15988 char *v2; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15989 int v3; // edi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15990 char Str[200]; // [sp+Ch] [bp-120h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15991 GUIWindow v5; // [sp+D4h] [bp-58h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15992 GUIFont *pFont; // [sp+128h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15993
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15994 v0 = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15995 pFont = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15996 if ( ptr_F8B1E8 && !byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15997 strcpy(byte_5B0938, ptr_F8B1E8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15998 v5.uFrameWidth = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15999 v5.uFrameZ = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16000 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16001 if ( 352 - v1 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16002 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16003 pFont = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16004 v1 = pFontCreate->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16006 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16007 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16008 352 - v1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16009 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16010 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16011 pRenderer->DrawTextureIndexed(8u, 347 - v1, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16012 v2 = FitTextInAWindow(byte_5B0938, pFont, &v5, 0xCu, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16013 pGUIWindow2->DrawText(pFont, 12, 354 - v1, 0, v2, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16014 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16015 if ( pGUIWindow2->field_40 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16016 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16017 if ( pGUIWindow2->field_40 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16019 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16020 strcpy(GameUI_StatusBar_TimedString, (const char *)pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16021 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16022 sub_4452BB();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16023 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16024 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16025 if ( pGUIWindow2->field_40 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16026 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16027 pGUIWindow2->field_40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16028 LABEL_15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16029 memset(GameUI_StatusBar_TimedString, 0, 0xC8u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16030 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16031 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16032 if ( pGUIWindow2->ptr_1C == (void *)26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16033 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16034 sprintfex(Str, "%s %s", GameUI_StatusBar_TimedString, pKeyActionMap->pPressedKeysBuffer);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16035 v3 = pFontLucida->GetLineWidth(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16036 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16037 pGUIWindow2->DrawFlashingInputCursor(v3 + 13, 357, pFontLucida);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16038 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16040 if ( pKeyActionMap->pPressedKeysBuffer[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16042 pKeyActionMap->_459ED1(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16043 goto LABEL_15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16044 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16046
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16047 //----- (004451A8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16048 void __fastcall sub_4451A8_press_any_key(int a1, int a2, int a4)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16049 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16050 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16051 int v4; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16052
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16053 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16054 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16055 if ( !pGUIWindow2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16057 if ( pParty->uFlags & 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16058 pGame->Draw();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16059 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16060 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16061 pMiscTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16062 pEventTimer->Pause();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16063 dword_5C3418 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16064 dword_5C341C = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16065 _591094_decoration = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16066 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)19, a4, 0);
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16067 pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16068 pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16069 pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16070 pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16072 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16073
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16074 //----- (004452BB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16075 void __cdecl sub_4452BB()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16077 pGUIWindow2->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16078 pGUIWindow2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16079 _5C3420_pDecoration = _591094_decoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16080 dword_597F18 = dword_5C341C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16081 EventProcessor(dword_5C3418, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16082 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16083 _5C3420_pDecoration = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16084 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16085 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16086
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16087
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16088 //----- (00445308) --------------------------------------------------------
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16089 const char *__fastcall sub_445308(int a1)
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16090 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16091 if ( a1 == 10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16092 || a1 == 11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16093 || a1 == 12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16094 || a1 == 33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16095 || a1 == 34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16096 || a1 == 39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16097 || a1 == 40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16098 || a1 == 41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16099 || a1 == 42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16100 || a1 == 43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16101 || a1 == 52 )
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16102 return (const char *)*(&pNPCStats->field_13A60 + 5 * a1);
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16103 else
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16104 return pNPCTopics[407].pTopic;
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16105 }
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16106
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16108 //----- (00445350) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16109 void __cdecl DrawDialogueUI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16111 NPCData *v0; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16112 int v1; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16113 unsigned __int16 v2; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16114 unsigned int v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16115 char *v4; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16116 int v5; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16117 char *v6; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16118 char *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16119 unsigned int v8; // edi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16120 char *v9; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16121 char *v10; // eax@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16122 int v11; // eax@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16123 int v12; // esi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16124 char *v13; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16125 GUIButton *v14; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16126 GUIButton *v15; // edi@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16127 signed int v16; // eax@44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16128 int v17; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16129 int v18; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16130 int v19; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16131 int v20; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16132 int v21; // eax@50
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16133 int v22; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16134 unsigned int v23; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16135 const char *v24; // eax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16136 int v25; // eax@65
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16137 int v26; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16138 int v27; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16139 int v28; // eax@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16140 int v29; // eax@69
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16141 unsigned __int16 v30; // cx@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16142 int v31; // ecx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16143 int v32; // ebx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16144 unsigned int v33; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16145 GUIWindow *v34; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16146 int v35; // esi@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16147 int i; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16148 GUIButton *v37; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16149 int v38; // eax@95
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16150 signed int v39; // esi@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16151 signed int v40; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16152 unsigned int v41; // ebx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16153 int v42; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16154 GUIButton *v43; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16155 int v44; // eax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16156 unsigned int v45; // ecx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16157 unsigned __int16 *v46; // edx@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16158 unsigned __int16 v47; // ax@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16159 char pFont; // [sp+4h] [bp-110h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16160 int v49; // [sp+Ch] [bp-108h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16161 int v50; // [sp+14h] [bp-100h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16162 GUIWindow v51; // [sp+58h] [bp-BCh]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16163 GUIWindow v52; // [sp+ACh] [bp-68h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16164 char *Str; // [sp+100h] [bp-14h]@104
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16165 __int16 v54[2]; // [sp+104h] [bp-10h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16166 unsigned __int16 *v55; // [sp+108h] [bp-Ch]@82
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16167 GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16168 char *pInString; // [sp+110h] [bp-4h]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16170 if ( !pDialogueWindow )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16171 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16172 memcpy(&v51, pDialogueWindow, sizeof(v51));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16173 v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16174 v1 = sub_445C8B(uDialogue_SpeakingActorNPC_ID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16175 v51.uFrameWidth -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16176 v51.uFrameZ -= 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16177 *(int *)v54 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16178 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16179 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16180 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16181 pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16182 pRenderer->DrawTextureTransparent(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16183 0x1D4u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16184 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16185 (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16186 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16187 _4E5E50_transui_x - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16188 _4E5EE0_transui_y - 4,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16189 (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16190 pRenderer->DrawTextureIndexed(_4E5E50_transui_x, _4E5EE0_transui_y, pDialogueNPCPortraits[0]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16191 v3 = v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16192 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16194 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16195 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v0->pName, aNPCProfessionNames[v3]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16196 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16197 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16199 strcpy(pTmpBuf, v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16200 v4 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16202 v51.DrawText2(pFontArrus, 0x1E3u, 0x70u, v2, v4, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16203 pParty->GetPartyFame();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16204 if ( (signed int)uDialogueType > 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16206 if ( uDialogueType == 90 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16207 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16208 v7 = pGlobalTXT_LocalizationStrings[577]; // "Get back in there you wimps:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16209 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16210 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16211 if ( uDialogueType == 91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16213 sprintfex(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16214 pInString = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16215 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16216 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16218 if ( uDialogueType == 92 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16220 v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16221 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16222 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16223 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16224 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16225 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16226 if ( uDialogueType == 89 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16227 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16228 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
16229 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16231 if ( uDialogueType == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16232 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16233 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16234 goto LABEL_18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16235 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16236 if ( (signed int)uDialogueType > 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16238 if ( (signed int)uDialogueType > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16240 if ( uDialogueType == 77 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16241 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16242 v5 = 5 * v0->uProfession;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16243 if ( byte_F8B1EC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16245 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16246 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16248 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16249 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16250 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16251 LABEL_19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16252 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16253 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16254 LABEL_38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16255 pInString = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16256 goto LABEL_39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16258 LABEL_18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16259 v6 = (char *)*(&pNPCStats->field_13A64 + v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16260 goto LABEL_19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16262 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16264 if ( byte_5B0938[0] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16265 goto LABEL_24;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
16266 v7 = (char *)ptr_F8B1E8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16267 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16268 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16269 goto LABEL_38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16270 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16271 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16272 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16273 if ( *(int *)v54 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16274 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16275 v11 = v0->greet;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16276 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16277 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16279 v10 = (char *)*(&pNPCStats->field_17884 + ((v0->uFlags & 3) == 2) + 2 * v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16280 goto LABEL_32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16283 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16284 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16285 if ( *(int *)v54 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16286 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16287 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16288 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16289 v9 = (char *)*(&pNPCStats->field_13A68 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16290 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16291 v9 = (char *)*(&pNPCStats->field_13A64 + 5 * v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16292 v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16293 LABEL_32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16294 pInString = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16295 if ( v10 == (char *)v8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16296 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16297 LABEL_39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16298 v49 = 460;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16299 v50 = 452;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16300 pOutString = pFontArrus;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16301 v12 = pFontArrus->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16302 if ( 352 - v12 < 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16303 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16304 pOutString = pFontCreate;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16305 v12 = pFontCreate->CalcTextHeight(pInString, (GUIWindow *)&pFont, 13, v8) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16307 pRenderer->_4A6A68(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16308 8u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16309 352 - v12,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16310 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16311 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16312 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16313 v13 = FitTextInAWindow(pInString, pOutString, (GUIWindow *)&pFont, 0xDu, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16314 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16315 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16318 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16319 memcpy(&v52, pDialogueWindow, sizeof(v52));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16320 v52.uFrameX = 483;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16321 v52.uFrameWidth = 148;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16322 v52.uFrameZ = 334;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16323 for ( pOutString = (GUIFont *)v52.pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16324 (signed int)pOutString < v52.pStartingPosActiveItem + v52.pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16325 pOutString = (GUIFont *)((char *)pOutString + 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16327 v14 = v52.GetControl((unsigned int)pOutString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16328 v15 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16329 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16330 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16331 v16 = v14->uControlParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16332 if ( v16 > 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16333 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16334 v25 = v16 - 76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16335 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16337 v26 = v25 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16338 if ( v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16340 v27 = v26 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16341 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16343 v28 = v27 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16344 if ( v28 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16346 v29 = v28 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16347 if ( v29 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16349 if ( v29 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16350 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16351 v24 = pGlobalTXT_LocalizationStrings[581];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16353 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16355 v24 = pGlobalTXT_LocalizationStrings[580];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16358 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16360 v24 = pGlobalTXT_LocalizationStrings[579];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16363 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16365 v24 = pGlobalTXT_LocalizationStrings[578];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16368 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16370 v24 = pGlobalTXT_LocalizationStrings[407];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16373 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16374 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16375 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16376 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16377 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16378 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[408], v0->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16379 v24 = pTmpBuf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16380 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16381 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16382 v24 = pGlobalTXT_LocalizationStrings[406];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16383 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16384 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16385 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16386 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16387 if ( v16 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16388 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16389 v23 = v0->evtf;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16390 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16391 v24 = (&dword_721660)[8 * v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16392 if ( !v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16393 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16394 v24 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16395 v15->uControlParam = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16396 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16397 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16398 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16399 v17 = v16 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16400 if ( !v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16401 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16402 v24 = (const char *)sub_445308(v0->uProfession);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16403 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16405 v18 = v17 - 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16406 if ( v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16407 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16408 v19 = v18 - 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16409 if ( !v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16411 v23 = v0->bDrawSomeAnim;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16412 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16414 v20 = v19 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16415 if ( !v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16417 v23 = v0->evtb;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16418 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16419 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16420 v21 = v20 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16421 if ( !v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16423 v23 = v0->evtc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16424 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16426 v22 = v21 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16427 if ( !v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16429 v23 = v0->evtd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16430 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16432 if ( v22 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16434 v23 = v0->evte;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16435 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16437 LABEL_71:
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
16438 v24 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16439 goto LABEL_79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16440 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16441 if ( v0->uFlags & 0x80 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16442 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16443 v24 = pGlobalTXT_LocalizationStrings[122];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16444 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16445 LABEL_79:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16446 if ( pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16448 pInString = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16449 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16450 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
16451 v55 = (unsigned short *)&pActors[0].uAIState;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16452 *(int *)v54 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16453 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16454 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16455 v30 = *v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16456 if ( *v55 == 5 || v30 == 11 || v30 == 19 || (v31 = *((int *)v55 + 159)) != 0 && (v31 & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16457 ++pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16458 v55 += 418;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16459 --*(int *)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16461 while ( *(int *)v54 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16463 if ( pInString == (char *)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16464 v24 = pGlobalTXT_LocalizationStrings[658];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16466 strcpy(v15->pButtonName, v24);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16468 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16469 pInString = (char *)GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16470 v33 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16471 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16472 *(int *)v54 = v33;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16473 v35 = pDialogueWindow->pStartingPosActiveItem;
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16474 for ( i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16476 v37 = v34->GetControl(v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16477 if ( !v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16479 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16480 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16481 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16482 v38 = pFontArrus->CalcTextHeight(v37->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16483 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16484 v32 += v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16485 ++v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16486 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16487 v39 = v34->pNumPresenceButton;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16488 if ( v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16489 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16490 pOutString = (GUIFont *)((174 - v32) / v39);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16491 if ( (174 - v32) / v39 > 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16492 pOutString = (GUIFont *)32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16493 v55 = (unsigned __int16 *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16494 v40 = 174 - (int)pOutString * v39 - v32;
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16495 v41 = v34->pStartingPosActiveItem;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16496 v42 = v40 / 2 - (signed int)pOutString / 2 + 138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16497 if ( (signed int)v41 < (signed int)(v41 + v39) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16498 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16499 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16500 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16501 v43 = v34->GetControl(v41);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16502 if ( !v43 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16503 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16504 v43->uY = (unsigned int)((char *)pOutString + v42);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16505 Str = v43->pButtonName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16506 v44 = pFontArrus->CalcTextHeight(v43->pButtonName, &v52, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16507 v45 = v43->uY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16508 v46 = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16509 v43->uHeight = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16510 v42 = v45 + v44 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16511 v43->uW = v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16512 v47 = v54[0];
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16513 if ( (unsigned __int16 *)pDialogueWindow->pCurrentPosActiveItem != v46 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16514 v47 = (unsigned __int16)pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16515 v52.DrawText2(pFontArrus, 0, v45, v47, Str, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16516 v34 = pDialogueWindow;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16517 v55 = (unsigned __int16 *)((char *)v55 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16518 ++v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16519 }
48
6a62c4005f0e 23.10.12
Ritor1
parents: 44
diff changeset
16520 while ( (signed int)v41 < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem );
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16521 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16523 pRenderer->DrawTextureIndexed(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16524 0x1D7u,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16525 0x1BDu,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16526 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16529 //----- (004459F9) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16530 NPCData *__fastcall GetNPCData(unsigned int npcid)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16532 unsigned int v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16533 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16534 int v3; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16535 int v4; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16536 int v5; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16537 NPCData *v6; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16538 char *v7; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16539 NPCData *v8; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16540 char v9; // al@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16541 std::string v10; // [sp-18h] [bp-2Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16542 const char *v11; // [sp-8h] [bp-1Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16543 int v12; // [sp-4h] [bp-18h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16544 std::string *v13; // [sp+Ch] [bp-8h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16545 int a3; // [sp+13h] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16546
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16547 v1 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16548 if ( (npcid & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16550 if ( (signed int)npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16551 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16552 if ( (signed int)npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16553 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16554 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
16555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16556 return &pNPCStats->pNewNPCData[v1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16557 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16558 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16560 if ( (signed int)npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16561 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16562 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16563 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16564 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16566 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16568 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16569 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16570 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16571 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16572 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16573 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16574 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16575 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16576 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16577 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16579 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16580 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16581 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16582 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16583 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16584 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16585 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16586 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16587 if ( v8->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16588 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16589 && (!pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16590 *v7++ = (char)v13 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16591 v13 = (std::string *)((char *)v13 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16592 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16593 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16594 while ( (signed int)v13 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16596 v9 = pTmpBuf[v3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16597 if ( (unsigned __int8)v9 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16598 result = &pNPCStats->pNPCData[(unsigned __int8)v9 + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16599 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16600 result = &pParty->pHirelings[(unsigned __int8)v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16601 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16602 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16603 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16604
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16605 //----- (00445B2C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16606 NPCData *__fastcall GetNewNPCData(signed int npcid, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16607 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16608 signed int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16609 int v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16610 NPCData *result; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16611 int v5; // esi@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16612 int v6; // ecx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16613 int v7; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16614 NPCData *v8; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16615 NPCData *v9; // edi@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16616 int v10; // ecx@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16617 char v11; // al@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16618 std::string v12; // [sp-18h] [bp-34h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16619 const char *v13; // [sp-8h] [bp-24h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16620 int v14; // [sp-4h] [bp-20h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16621 std::string *v15; // [sp+Ch] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16622 char *v16; // [sp+10h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16623 int v17; // [sp+14h] [bp-8h]@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16624 int a3; // [sp+1Bh] [bp-1h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16625
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16626 v2 = npcid;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16627 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16628 v15 = (std::string *)a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16629 if ( npcid >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16631 if ( npcid < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16633 if ( npcid >= 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16635 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
16636 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16637 *(int *)v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16638 return &pNPCStats->pNewNPCData[v2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16639 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16640 LABEL_7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16641 *(int *)a2 = npcid - 5000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16642 return &pNPCStats->array_13EF4[npcid - 5000];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16643 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16644 if ( npcid >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16645 goto LABEL_7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16646 if ( (uDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16648 *(int *)a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16649 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16650 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16651 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16652 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16653 v5 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16654 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16655 v7 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16656 v8 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16657 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16658 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16659 if ( v8->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16660 pTmpBuf[v6++] = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16661 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16662 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16663 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16664 while ( (signed int)v8 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16665 v17 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16666 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16668 v9 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16669 v16 = &pTmpBuf[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16670 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16672 if ( v9->uFlags & 0x80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16673 && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16674 && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16675 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16676 v10 = (int)v16++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16677 *(char *)v10 = v17 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16679 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16680 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16681 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16682 while ( v17 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16683 v3 = (int)v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16684 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16685 v11 = pTmpBuf[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16686 if ( (unsigned __int8)v11 >= 2u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16687 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16688 *(int *)v3 = (unsigned __int8)v11 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16689 result = &pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[v5] + 499];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16690 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16691 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16692 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16693 *(int *)v3 = (unsigned __int8)v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16694 result = &pParty->pHirelings[(unsigned __int8)pTmpBuf[v5]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16696 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16697 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16699
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16700 //----- (00445C8B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16701 int __fastcall sub_445C8B(signed int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16702 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16703 signed int v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16704 int v3; // edi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16705 int v4; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16706 int v5; // edx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16707 NPCData *v6; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16708 char *v7; // ebp@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16709 NPCData *v8; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16710
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16711 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16712 if ( a1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16713 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16714 if ( a1 < 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16715 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16716 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16718 if ( a1 >= 5000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16719 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16720 v3 = abs((int)uDialogue_SpeakingActorNPC_ID) - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16721 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16722 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16723 v6 = pParty->pHirelings;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16724 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16726 if ( v6->pName )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16727 pTmpBuf[v4++] = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16728 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16729 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16731 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16732 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16733 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16734 v7 = &pTmpBuf[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16735 v8 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16736 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16737 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16738 if ( v8->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16740 if ( !pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16741 *v7++ = v1 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16743 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16744 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16746 while ( v1 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16748 return ((unsigned __int8)pTmpBuf[v3] < 2u) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16749 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16750
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16751
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16752 //----- (0044603D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16753 void __cdecl sub_44603D()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16755 uDialogue_SpeakingActorNPC_ID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16756 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16757 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16758 pMiscTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16759 pEventTimer->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16760 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16761
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16762
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16763 //----- (004465DF) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16764 int sub_4465DF_check_season(int a1)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16766 unsigned int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16767 unsigned int v2; // edx@1
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16768 int v3; // ecx@2
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16769 int v4; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16770 char v6; // zf@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16771
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16772 v1 = pParty->uCurrentMonth + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16773 v2 = pParty->uDaysPlayed + 1;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16774 if ( a1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16775 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16776 v3 = a1 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16777 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16778 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16779 v4 = v3 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16780 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16782 if ( v4 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16783 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16784 if ( v1 != 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16786 if ( (signed int)v1 >= 1 && (signed int)v1 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16787 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16788 v6 = v1 == 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16789 LABEL_24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16790 if ( !v6 || (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16791 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16792 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16794 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16795 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16797 if ( v1 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16799 if ( (signed int)v1 >= 10 && (signed int)v1 <= 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16800 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16801 v6 = v1 == 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16802 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16806 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16807 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16808 if ( v1 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16809 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16810 if ( (signed int)v1 >= 7 && (signed int)v1 <= 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16811 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16812 v6 = v1 == 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16813 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16817 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16819 if ( v1 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16821 if ( (signed int)v1 >= 4 && (signed int)v1 <= 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16822 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16823 v6 = v1 == 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16824 goto LABEL_24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16825 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16826 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16827 if ( (signed int)v2 >= 21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16828 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16829 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16830 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16831
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16832 //----- (0044665D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16833 // uType: 0 -> any monster
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16834 // 1 -> uParam is GroupID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16835 // 2 -> uParam is MonsterID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16836 // 3 -> uParam is ActorID
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16837 // uNumAlive: 0 -> all must be alive
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16838 int __fastcall IsActorAlive(unsigned int uType, unsigned int uParam, unsigned int uNumAlive)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16839 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16840 unsigned int uAliveActors; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16841 int v5; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16842 unsigned int uTotalActors; // [sp+0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16843
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16844 uTotalActors = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16845 if ( uType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16847 if ( uType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16849 uAliveActors = SearchActorByGroup(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16850 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16851 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16852 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16853 if ( uType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16854 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16855 uAliveActors = SearchActorByMonsterID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16857 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16858 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16859 if ( uType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16860 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16861 uAliveActors = SearchActorByID(&uTotalActors, uParam);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16864 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16865 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16867 uAliveActors = SearchAliveActors(&uTotalActors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16868 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16869 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16870 if ( uNumAlive )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16871 LOBYTE(v5) = (signed int)uAliveActors >= (signed int)uNumAlive;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16872 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16873 LOBYTE(v5) = uTotalActors == uAliveActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16874 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16876
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16877 //----- (004466C4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16878 bool __thiscall sub_4466C4(void *_this)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16879 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16880 signed int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16881 bool result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16882 int v3; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16883 signed int v4; // edx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16884 signed int v5; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16885 unsigned int v6; // ebx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16886 char *v7; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16887 signed int v8; // edi@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16888 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16889 Player *v10; // [sp+8h] [bp-10h]@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16890 signed int v11; // [sp+Ch] [bp-Ch]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16891 signed int v12; // [sp+10h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16892 void *v13; // [sp+14h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16893
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16894 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16895 v13 = _this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16896 if ( !_this )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16897 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16898 v3 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16899 pSomeOtherEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16900 uSomeOtherEVT_NumEvents = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16901 memcpy(pSomeOtherEVT_Events, pGlobalEVT_Events, 0xCE40u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16902 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16903 v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16904 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16905 if ( (signed int)uSomeOtherEVT_NumEvents <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16906 goto LABEL_16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16907 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16908 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16909 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16910 if ( (void *)pSomeOtherEVT_Events[v1].uEventID == v13 && pSomeOtherEVT_Events[v5].field_4 == v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16911 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16912 v6 = pSomeOtherEVT_Events[v5].uEventOffsetInEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16913 v7 = &pSomeOtherEVT[v6];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16914 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16915 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16916 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16917 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16918 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16919 v10 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16920 v8 = (unsigned __int8)v7[7]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16921 + (((unsigned __int8)v7[8] + (((unsigned __int8)v7[9] + ((unsigned __int8)v7[10] << 8)) << 8)) << 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16922 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16923 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16924 LOBYTE(v9) = v10->CompareVariable(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16925 (enum VariableType)((unsigned __int8)pSomeOtherEVT[v6 + 5]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16926 + ((unsigned __int8)pSomeOtherEVT[v6 + 6] << 8)),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16927 v8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16928 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16929 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16930 ++v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16931 if ( (signed int)v10 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16932 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16933 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16934 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16935 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16936 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16937 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16938 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16939 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] == 46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16940 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16941 v11 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16942 v12 = (unsigned __int8)v7[5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16943 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16944 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16945 if ( (unsigned __int8)pSomeOtherEVT[v6 + 4] != 52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16946 || !IsActorAlive(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16947 (unsigned __int8)v7[5],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16948 (unsigned __int8)v7[6]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16949 + (((unsigned __int8)v7[7] + (((unsigned __int8)v7[8] + ((unsigned __int8)v7[9] << 8)) << 8)) << 8),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16950 (unsigned __int8)v7[10]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16951 goto LABEL_13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16952 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16953 v1 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16954 v3 = (unsigned __int8)pSomeOtherEVT[v6 + 11] - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16955 LABEL_13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16956 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16957 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16958 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16959 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16960 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16961 while ( v1 < (signed int)uSomeOtherEVT_NumEvents );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16962 if ( v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16963 result = v12 != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16964 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16965 LABEL_16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16966 result = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16967 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16969
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16970
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16971 //----- (0044684A) --------------------------------------------------------
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16972 void __fastcall EventProcessor(int uEventID, int a2, int a3)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16974 unsigned int v3; // eax@5
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16975 //signed int v4; // esi@7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16976 //char *v5; // eax@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16977 Player *v6; // ecx@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16978 //char *v7; // ebp@8
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16979 //signed int v8; // edx@10
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16980 //int v9; // edi@12
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16981 //ByteArray *v10; // esi@12
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16982 int v11; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16983 char *v12; // eax@15
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
16984 //char *v13; // edi@21
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16985 int v14; // ebp@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16986 int v15; // edi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16987 const char *v16; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16988 bool v17; // edx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16989 int v18; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16990 int v19; // ebp@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16991 signed int v20; // ecx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16992 int v21; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16993 int v22; // edx@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16994 int v23; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16995 unsigned __int16 v24; // ax@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16996 int v25; // eax@54
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16997 LevelDecoration *v26; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16998 int v27; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16999 int v28; // ecx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17000 int v29; // edx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17001 int v30; // eax@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17002 int v31; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17003 int v32; // esi@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17004 NPCData *v33; // ecx@58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17005 int v34; // esi@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17006 int v35; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17007 int v36; // esi@61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17008 int v37; // esi@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17009 int v38; // eax@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17010 int v39; // ecx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17011 size_t v40; // edx@78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17012 char *v41; // esi@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17013 int v42; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17014 int v43; // ecx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17015 size_t v44; // edx@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17016 char *v45; // esi@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17017 void *v46; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17018 GUIWindow *v47; // eax@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17019 GUIButton *v48; // ecx@93
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17020 GUIButton *v49; // esi@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17021 char v50; // al@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17022 Player *v51; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17023 Player *v52; // ecx@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17024 int v53; // ecx@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17025 char v54; // al@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17026 Player *v55; // esi@114
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17027 Player *v56; // ecx@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17028 int v57; // ecx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17029 signed int v58; // ebp@124
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17030 Player *v59; // esi@125
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17031 int v60; // eax@126
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17032 int v61; // edx@133
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17033 int v62; // eax@139
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17034 void *v63; // ebp@145
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17035 signed int v64; // edi@146
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17036 unsigned int v65; // edx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17037 Player *v66; // ecx@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17038 int v67; // esi@148
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17039 signed int v68; // eax@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17040 int v69; // esi@151
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17041 Player *v70; // ecx@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17042 unsigned int v71; // eax@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17043 int v72; // esi@159
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17044 signed int v73; // eax@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17045 int v74; // esi@162
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17046 int v75; // edx@172
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17047 Player *v76; // esi@173
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17048 signed int v77; // ebp@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17049 int v78; // edx@186
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17050 Player *v79; // esi@187
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17051 signed int v80; // ebp@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17052 int v81; // edx@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17053 Player *v82; // esi@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17054 int v83; // eax@212
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17055 int v84; // ebp@220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17056 signed int v85; // ebp@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17057 char v86; // al@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17058 Player *v87; // esi@227
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17059 Player *v88; // ecx@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17060 int v89; // ecx@232
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17061 int v90; // eax@243
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17062 const char *v91; // ecx@247
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17063 int v92; // eax@251
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17064 char *v93; // eax@252
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17065 int v94; // ecx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17066 int v95; // ebp@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17067 int v96; // edx@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17068 int v97; // eax@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17069 unsigned int v98; // edx@265
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17070 const char *v99; // esi@267
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17071 int v100; // edx@267
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17072 //char *v101; // edi@281
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17073 unsigned int v102; // esi@281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17074 int v103; // edi@284
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17075 int v104; // eax@288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17076 int v105; // edx@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17077 int v106; // [sp-20h] [bp-4C8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17078 signed int v107; // [sp-1Ch] [bp-4C4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17079 unsigned int v108; // [sp-18h] [bp-4C0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17080 signed int v109; // [sp-14h] [bp-4BCh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17081 signed int v110; // [sp-10h] [bp-4B8h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17082 int v111; // [sp-Ch] [bp-4B4h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17083 Event *v112; // [sp-8h] [bp-4B0h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17084 int v113; // [sp-8h] [bp-4B0h]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17085 int v114; // [sp-8h] [bp-4B0h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17086 signed int v115; // [sp-8h] [bp-4B0h]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17087 unsigned int v116; // [sp-8h] [bp-4B0h]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17088 int v117; // [sp-4h] [bp-4ACh]@106
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17089 int v118; // [sp-4h] [bp-4ACh]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17090 int v119; // [sp-4h] [bp-4ACh]@231
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17091 int v120; // [sp-4h] [bp-4ACh]@278
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17092 int v121; // [sp-4h] [bp-4ACh]@294
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17093 int v122; // [sp+10h] [bp-498h]@4
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17094 //char *v123; // [sp+14h] [bp-494h]@0
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17095 //signed int v124; // [sp+18h] [bp-490h]@7
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17096 signed int v125; // [sp+1Ch] [bp-48Ch]@155
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17097 int v126; // [sp+1Ch] [bp-48Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17098 int v127; // [sp+20h] [bp-488h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17099 int v128; // [sp+24h] [bp-484h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17100 int v129; // [sp+24h] [bp-484h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17101 signed int v130; // [sp+28h] [bp-480h]@0
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17102 //int v131; // [sp+2Ch] [bp-47Ch]@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17103 int v132; // [sp+30h] [bp-478h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17104 signed int v133; // [sp+34h] [bp-474h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17105 int v134; // [sp+38h] [bp-470h]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17106 int v135; // [sp+3Ch] [bp-46Ch]@262
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17107 int v136; // [sp+40h] [bp-468h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17108 int v137; // [sp+44h] [bp-464h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17109 int v138; // [sp+48h] [bp-460h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17110 int v139; // [sp+4Ch] [bp-45Ch]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17111 ItemGen item; // [sp+50h] [bp-458h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17112 char Source[120]; // [sp+74h] [bp-434h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17113 char Str[120]; // [sp+ECh] [bp-3BCh]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17114 Actor Dst; // [sp+164h] [bp-344h]@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17115
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17116 //v131 = uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17117 v133 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17118 dword_5B5920 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17119 dword_5B65C4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17120 if ( !a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17122 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17123 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17124 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17126 v127 = 2 * (uActiveCharacter == 0) + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17127 v122 = dword_597F18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17128 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17129 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17130 v3 = uGlobalEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17131 pSomeEVT = pGlobalEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17132 v112 = pGlobalEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17134 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17135 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17136 v3 = uLevelEVT_NumEvents;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17137 pSomeEVT = pLevelEVT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17138 v112 = pLevelEVT_Events;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17139 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17140 uSomeEVT_NumEvents = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17141 memcpy(pSomeEVT_Events, v112, 0xCE40u);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17142 //v4 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17143 //v124 = 0;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17144 for (uint i = 0; i < uSomeEVT_NumEvents; ++i)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17145 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17146 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17147 //v6 = v123;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
17148 //v7 = "";
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17149 //while ( 1 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17150 //{
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17151 if ( dword_5B65C4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17152 goto LABEL_301;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17153 //v8 = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17154 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
17155 {
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17156 //v9 = pSomeEVT_Events[v8].uEventOffsetInEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17157 //v10 = (ByteArray *)&v5[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17158 auto _evt = (_evt_raw *)(pSomeEVT + pSomeEVT_Events[i/*v4*/].uEventOffsetInEVT);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17159
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17160 switch (_evt->v4)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17162 case EVENT_CheckSeason:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17163 if ( !sub_4465DF_check_season(_evt->v5) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17164 goto LABEL_291;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17165 v11 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17166 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17167 case EVENT_ShowMovie:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17168 strcpy(Source, (char *)&_evt->v7);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17169 v12 = (char *)&item.uExpireTime + strlen(Source) + 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17170 if ( *v12 == 32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17171 *v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17172 if ( pVideoPlayer->field_54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17173 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17174 pVideoPlayer->bStopBeforeSchedule = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17175 pVideoPlayer->field_40 = 0;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17176 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17177 pAsyncMouse->Suspend();
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
17178 v128 = pCurrentScreen;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17179 //v13 = &pSomeEVT[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17180 //v14 = (unsigned __int8)v13[5];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17181 //v15 = (unsigned __int8)v13[6];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17182 v14 = _evt->v5;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17183 v15 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17184 strcpy(Str, Source);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17185 v16 = RemoveQuotes(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17186 VideoPlayer::MovieLoop(v16, 0, v14, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17187 if ( !_strcmpi(v16, "arbiter good") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17188 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17189 pParty->uAlignment = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17190 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17191 LABEL_23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17192 LOBYTE(v17) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17193 SetUserInterface(v18, v17);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17194 goto LABEL_28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17195 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17196 if ( !_strcmpi(v16, "arbiter evil") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17198 v18 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17199 pParty->uAlignment = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17200 goto LABEL_23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17202 if ( !_strcmpi(v16, "pcout01") ) // moving to harmondale from emerald isle
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17203 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17204 Rest(0x2760u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17205 pParty->RestAndHeal();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17206 pParty->field_764 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17208 LABEL_28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17209 if ( !v15 || v128 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17210 {
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
17211 pCurrentScreen = v128;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17212 if ( v128 == 3 )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
17213 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17214 if ( v128 == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17215 pVideoPlayer->_4BF28F(pAnimatedRooms[uCurrentHouse_Animation].field_0, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17216 }
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17217 if (pAsyncMouse)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17218 pAsyncMouse->Resume();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17219 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17220 case EVENT_CheckSkill:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17221 v19 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((unsigned int)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17222 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17223 goto LABEL_47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17224 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17225 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17226 v24 = pParty->pPlayers[0].pActiveSkills[3486 * v127 + _evt->v5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17228 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17229 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17230 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17231 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17232 v24 = pPlayers[uActiveCharacter]->pActiveSkills[_evt->v5];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17234 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17236 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17238 v20 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17239 v21 = 3486 * v130 + _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17240 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17241 LOWORD(v21) = pParty->pPlayers[0].pActiveSkills[v21];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17242 v137 = v21 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17243 v138 = v21 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17244 v22 = v21 & 0x100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17245 v23 = v21 & 0x3F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17246 v139 = v22;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17247 while ( v23 < v19 || !*(&v136 + _evt->v6) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17249 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17250 if ( v20 >= 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17251 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17253 LABEL_50:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17254 v11 = _evt->v11;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17255 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17257 LABEL_47:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17258 //v10 = (ByteArray *)&v5[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17259 v24 = pParty->pPlayers[0].pActiveSkills[_evt->v5 + 3486 * rand() % 4];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17260 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17262 v136 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17263 v137 = v24 & 0x40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17264 v138 = v24 & 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17265 v139 = v24 & 0x100;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17266 if ( (v24 & 0x3F) >= v19 && *(&v136 + _evt->v6) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17267 goto LABEL_50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17268 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17269 case EVENT_SpeakNPC:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17270 if ( a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17271 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17272 //Actor::Actor(&Dst);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17273 memset(&Dst, 0, 0x344u);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17274 dword_5B65D0_dialogue_actor_npc_id = _evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17275 + ((_evt->v6
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17276 + ((_evt->v7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17277 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17278 Dst.uNPC_ID = dword_5B65D0_dialogue_actor_npc_id;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17279 Dst.InitializeDialogue(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17280 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17281 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17282 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17283 bDialogueUI_InitializeActor_NPC_ID = _evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17284 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17285 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17286 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17287 case EVENT_ChangeEvent:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17288 v25 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((unsigned int)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17289 if ( v25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17290 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17291 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = _evt->v5 - 124;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17293 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17295 v26 = _5C3420_pDecoration;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17296 stru_5E4C90.field_0[_5C3420_pDecoration->field_1C] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17297 LOBYTE(v26->field_2) |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17299 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17300 case EVENT_SetNPCGreeting:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17301 v27 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17302 v28 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17303 pNPCStats->pNewNPCData[v27].uFlags &= 0xFFFFFFFCu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17304 pNPCStats->pNewNPCData[v27].greet = v28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17305 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17306 case EVENT_SetNPCTopic:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17307 v29 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17308 v30 = _evt->v10 + ((_evt->v11 + ((_evt->v12 + ((uint)_evt->v13 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17309 v31 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17310 v32 = _evt->v9;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17311 v33 = &pNPCStats->pNewNPCData[v31];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17312 if ( v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17313 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17314 v34 = v32 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17315 if ( v34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17316 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17317 v35 = v34 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17318 if ( v35 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17319 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17320 v36 = v35 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17321 if ( v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17323 v37 = v36 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17324 if ( v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17326 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17327 v33->evtf = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17328 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17329 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17331 v33->evte = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17332 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17333 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17334 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17335 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17336 v33->evtd = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17337 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17339 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17340 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17341 v33->evtc = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17342 }
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 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17346 v33->evtb = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17348 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17349 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17350 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17351 v33->bDrawSomeAnim = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17353 if ( v29 == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17355 if ( v30 == 78 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17356 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17357 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17358 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17359 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17360 if ( EnterHouse((enum HOUSE_TYPE)170) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17361 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17362 pAudioPlayer->StopChannels(-1, -1);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17363 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 170, 0);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17364 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17365 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17366 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17367 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17368 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17369 ptr_F8B1E8 = pNPCTopics[90].pText;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17370 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17372 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17373 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17374 case EVENT_NPCSetItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17375 sub_448518_npc_set_item(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17376 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17377 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17378 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17379 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17380 case EVENT_SetActorItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17381 Actor::GiveItem(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17382 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17383 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17384 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17385 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17386 case EVENT_SetNPCGroupNews:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17387 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
17388 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17389 case EVENT_SetActorGroup:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17390 __debugbreak();
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17391 *(&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
17392 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17393 case EVENT_ChangeGroup:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17394 v38 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17395 v39 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17396 v40 = uNumActors;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17397 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17398 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17400 v41 = (char *)&pActors[0].uGroup;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17401 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17403 if ( *(int *)v41 == v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17404 *(int *)v41 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17405 v41 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17406 --v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17407 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17408 while ( v40 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17410 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17411 case EVENT_ChangeGroupAlly:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17412 v42 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17413 v43 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17414 v44 = uNumActors;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17415 __debugbreak();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17416 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17418 v45 = (char *)&pActors[0].uAlly;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17419 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17420 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17421 if ( *((int *)v45 - 1) == v42 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17422 *(int *)v45 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17423 v45 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17424 --v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17425 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17426 while ( v44 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17428 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17429 case EVENT_MoveNPC:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17430 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
17431 if ( ptr_507BC0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17432 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17433 v46 = ptr_507BC0->ptr_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17434 if ( v46 == (void *)165 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17435 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17436 sub_4BD8B5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17437 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17438 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17439 pParty->uFlags &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17440 _5C3420_pDecoration = (LevelDecoration *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17441 if ( EnterHouse((enum HOUSE_TYPE)165) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17443 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
17444 v47 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, 165, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17445 ptr_507BC0 = v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17446 v48 = v47->pControlsHead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17447 if ( v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17448 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17449 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17450 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17451 v49 = v48->pNext;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17452 pAllocator->FreeChunk(v48);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17453 v48 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17455 while ( v49 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17456 v47 = ptr_507BC0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17458 v47->pControlsHead = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17459 ptr_507BC0->pControlsTail = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17460 ptr_507BC0->uNumControls = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17463 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17465 if ( v46 == (void *)553 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17466 pVideoPlayer->bLoopPlaying = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17469 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17470 case EVENT_Jmp:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17471 //v124 = -1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17472 v122 = _evt->v5 - 1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17473 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17474 case EVENT_ShowFace:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17475 v50 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17476 if ( (unsigned __int8)v50 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17478 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17479 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17480 v53 = (unsigned __int8)v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17481 goto LABEL_108;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17482 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17483 if ( v50 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17485 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17486 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17487 v52 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17488 goto LABEL_109;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17490 if ( v50 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17491 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17492 v117 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17493 v113 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17494 v53 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17495 LABEL_108:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17496 v52 = &pParty->pPlayers[v53];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17497 LABEL_109:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17498 v52->PlayEmotion(v113, v117);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17499 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17500 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17501 v51 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17502 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17503 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17504 v51->PlayEmotion(_evt->v6, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17505 ++v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17506 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17507 while ( (signed int)v51 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17508 LABEL_291:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17509 ++v122;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17510 //v4 = v124;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17511 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17512 //v6 = v123;
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
17513 //v7 = "";
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17514 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17515 case EVENT_CharacterAnimation:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17516 v54 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17517 if ( (unsigned __int8)v54 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17519 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17520 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17521 v57 = (unsigned __int8)v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17522 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17524 if ( v54 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17526 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17527 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17528 v56 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17529 goto LABEL_120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17531 if ( v54 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17532 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17533 v118 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17534 v114 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17535 v57 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17536 LABEL_119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17537 v56 = &pParty->pPlayers[v57];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17538 LABEL_120:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17539 v56->PlaySound(v114, v118);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17540 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17542 v55 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17543 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17544 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17545 v55->PlaySound(_evt->v6, 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17546 ++v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17547 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17548 while ( (signed int)v55 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17549 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17550 case EVENT_ForPartyMember:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17551 v127 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17552 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17553 case EVENT_SummonItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17554 sub_42F7EB_DropItemAt(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17555 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17556 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17557 _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17558 _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17559 _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17560 _evt->v25,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17561 _evt->v26,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17562 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17563 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17564 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17565 case EVENT_Compare:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17566 v58 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17567 if ( v127 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17569 v130 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17570 v59 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17571 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17573 LOBYTE(v60) = v59->CompareVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17574 (enum VariableType)(_evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17575 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17576 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17577 if ( v60 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17578 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17579 ++v130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17580 ++v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17581 if ( (signed int)v59 >= (signed int)pParty->pHirelings )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17582 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17584 LABEL_129:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17585 v11 = _evt->v11;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17586 goto LABEL_130;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17587 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17588 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17589 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17590 v61 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17591 if ( v127 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17592 goto LABEL_137;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17593 if ( v127 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17594 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17595 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17596 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17597 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17598 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17600 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17601 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17603 if ( v127 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17604 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17605 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17606 v61 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17607 //v5 = pSomeEVT;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17608 LABEL_137:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17609 v6 = &pParty->pPlayers[v61];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17610 LABEL_138:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17611 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17612 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17613 LOBYTE(v62) = ((Player *)v6)->CompareVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17614 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17615 v58);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17616 LABEL_140:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17617 if ( v62 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17618 goto LABEL_129;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17619 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17620 case EVENT_IsActorAlive:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17621 v62 = IsActorAlive(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17622 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17623 _evt->v6 + ((_evt->v7 + ((_evt->v8 + ((uint)_evt->v9 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17624 _evt->v10);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17625 goto LABEL_140;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17626 case EVENT_Substract:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17627 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
17628 if ( _evt->v5 + ((uint)_evt->v6 << 8) == VAR_PlayerItemInHands )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17629 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17630 v64 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17631 if ( (void *)pParty->pPickedItem.uItemID == v63 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17632 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17633 pMouse->RemoveHoldingItem();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17634 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17635 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17636 v65 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17637 v66 = pPlayers[uActiveCharacter];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17638 v67 = (int)v66->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17639 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17640 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17641 if ( *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v67 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17642 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17643 v66->RemoveItemAtInventoryIndex(v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17644 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17645 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17646 ++v65;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17647 v67 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17648 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17649 while ( (signed int)v65 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17650 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17651 v69 = (int)&v66->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17652 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17653 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17654 if ( *(int *)v69 && *(void **)&v66->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v69 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17656 *(&v66->pEquipment.uOffHand + v68) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17657 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17658 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17659 ++v68;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17660 v69 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17662 while ( v68 < 16 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17663 v125 = (signed int)&pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17664 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17666 v70 = *(Player **)v125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17667 if ( !v64 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17668 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17669 v71 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17670 v72 = (int)v70->pInventoryIndices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17671 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17672 {
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17673 if ( *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v72 + 5] == v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17674 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17675 v70->RemoveItemAtInventoryIndex(v71);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17676 goto LABEL_169;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17677 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17678 ++v71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17679 v72 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17680 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17681 while ( (signed int)v71 < 126 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17682 v73 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17683 v74 = (int)&v70->pEquipment;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17684 while ( !*(int *)v74
23
509744251c8e Player-related members
Nomad
parents: 3
diff changeset
17685 || *(void **)&v70->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v74 + 5] != v63 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17686 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17687 ++v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17688 v74 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17689 if ( v73 >= 16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17690 goto LABEL_170;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17691 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17692 *(&v70->pEquipment.uOffHand + v73) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17693 LABEL_169:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17694 v64 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17695 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17696 LABEL_170:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17697 v125 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17698 if ( v125 > (signed int)&pPlayers[4] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17699 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17700 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17701 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17702 v75 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17703 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17704 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17705 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17706 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17707 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17708 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17709 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17711 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17712 goto LABEL_180;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17713 LABEL_183:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17714 ((Player *)v6)->SubtractVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17715 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17716 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17717 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17719 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17720 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17721 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17722 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17724 LABEL_180:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17725 v75 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17726 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17727 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17728 v6 = &pParty->pPlayers[v75];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17729 LABEL_182:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17730 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17731 goto LABEL_183;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17733 v76 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17734 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17735 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17736 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17737 v76->SubtractVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17738 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17739 v63);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17740 ++v76;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17741 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17742 while ( (signed int)v76 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17743 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17744 case EVENT_Set:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17745 v77 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17746 v78 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17747 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17748 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17749 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17750 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17751 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17752 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17753 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17754 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17755 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17756 goto LABEL_194;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17757 LABEL_197:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17758 ((Player *)v6)->SetVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17759 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17760 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17761 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17763 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17764 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17765 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17766 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17767 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17768 LABEL_194:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17769 v78 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17770 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17771 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17772 v6 = &pParty->pPlayers[v78];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17773 LABEL_196:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17774 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17775 goto LABEL_197;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17777 v79 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17778 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17779 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17780 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17781 v79->SetVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17782 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17783 v77);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17784 ++v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17785 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17786 while ( (signed int)v79 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17787 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17788 case EVENT_Add:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17789 v80 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17790 v81 = v127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17791 if ( v127 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17792 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17793 if ( v127 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17794 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17795 if ( v127 > 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17797 if ( v127 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17798 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17799 if ( v127 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17800 goto LABEL_208;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17801 LABEL_211:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17802 ((Player *)v6)->AddVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17803 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17804 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17805 goto LABEL_212;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17806 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17807 if ( uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17808 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17809 v6 = pPlayers[uActiveCharacter];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17810 goto LABEL_210;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17812 LABEL_208:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17813 v81 = rand() % 4;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17814 //v5 = pSomeEVT;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17815 }
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17816 v6 = &pParty->pPlayers[v81];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17817 LABEL_210:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17818 //v123 = v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17819 goto LABEL_211;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17821 v82 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17822 v130 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17823 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17825 v82->AddVariable(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17826 (enum VariableType)(_evt->v5 + ((uint)_evt->v6 << 8)),
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17827 v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17828 ++v82;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17830 while ( (signed int)v82 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17831 LABEL_212:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17832 v83 = _evt->v5 + ((uint)_evt->v6 << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17833 if ( v83 == 21 || v83 == 22 || v83 == 23 || v83 == 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17834 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17835 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17836 case EVENT_InputString:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17837 if ( !dword_597F18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17838 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17839 strcpy(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17840 GameUI_StatusBar_TimedString,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17841 &pLevelStr[pLevelStrOffsets[_evt->v5
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17842 + ((_evt->v6
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17843 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8)]]);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17844 v105 = v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17845 v121 = 26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17846 LABEL_295:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17847 sub_4451A8_press_any_key(uEventID, v105, v121);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17848 LABEL_301:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17849 if ( v133 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17850 LABEL_302:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17851 OnMapLeave();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17852 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17853 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17854 v84 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17855 if ( !_strcmpi(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17856 GameUI_StatusBar_TimedString,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17857 &pLevelStr[pLevelStrOffsets[_evt->v9
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17858 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8)]])
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17859 || !_strcmpi(GameUI_StatusBar_TimedString, &pLevelStr[pLevelStrOffsets[v84]]) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17860 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17861 v11 = _evt->v17;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17862 LABEL_130:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17863 //v124 = -1;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17864 LABEL_131:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17865 v122 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17866 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17867 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17868 case EVENT_RandomGoTo:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17869 //v124 = -1;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17870 v11 = (unsigned __int8)*(&_evt->v5
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17871 + rand()
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17872 % ((_evt->v5 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17873 + (_evt->v6 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17874 + (_evt->v7 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17875 + (_evt->v8 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17876 + (_evt->v9 != 0)
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17877 + (_evt->v10 != 0)));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17878 goto LABEL_131;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17879 case EVENT_ReceiveDamage:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17880 v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17881 v86 = _evt->v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17882 if ( (unsigned __int8)v86 <= 3u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17883 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17884 v119 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17885 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17886 v89 = (unsigned __int8)v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17887 goto LABEL_233;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17889 if ( v86 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17890 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17891 if ( !uActiveCharacter )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17892 goto LABEL_291;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17893 v119 = _evt->v6;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17894 v88 = pPlayers[uActiveCharacter];
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17895 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17896 goto LABEL_234;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17897 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17898 if ( v86 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17899 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17900 v119 = _evt->v6;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17901 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v1 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17902 v89 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17903 LABEL_233:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17904 v88 = &pParty->pPlayers[v89];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17905 LABEL_234:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17906 v88->ReceiveDamage(v115, v119);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17907 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17909 v87 = pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17910 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17911 {
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17912 v87->ReceiveDamage(v85, _evt->v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17913 ++v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17914 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17915 while ( (signed int)v87 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17916 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17917 case EVENT_ToggleIndoorLight:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17918 pIndoor->ToggleLight(_evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8), _evt->v9);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17919 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17920 case EVENT_SetFacesBit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17921 sub_44892E_set_faces_bit(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17922 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17923 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17924 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17925 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17926 case EVENT_ToggleChestFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17927 Chest::ToggleFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17928 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17929 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17930 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17931 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17932 case EVENT_ToggleActorFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17933 Actor::ToggleFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17934 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17935 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17936 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17937 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17938 case EVENT_ToggleActorGroupFlag:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17939 ToggleActorGroupFlag(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17940 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17941 _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17942 _evt->v13);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17943 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17944 case EVENT_SetSnow:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17945 if ( !_evt->v5 )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17946 pWeather->bRenderSnow = _evt->v6 != 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17947 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17948 case EVENT_StatusText:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17949 v90 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17950 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17952 if ( _5C3420_pDecoration == (LevelDecoration *)1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17954 ptr_F8B1E8 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17955 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17957 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17959 v91 = (&dword_721664)[8 * v90];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17960 LABEL_248:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17961 ShowStatusBarString(v91, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17962 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17964 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17965 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17966 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17967 if ( a3 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17969 v91 = &pLevelStr[pLevelStrOffsets[v90]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17970 goto LABEL_248;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17972 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17973 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17974 case EVENT_ShowMessage:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17975 v92 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17976 if ( _5C3420_pDecoration )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17977 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17978 v93 = (&dword_721664)[8 * v92];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17979 byte_5B0938[0] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17980 ptr_F8B1E8 = v93;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17981 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17982 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17984 strcpy(byte_5B0938, &pLevelStr[pLevelStrOffsets[v92]]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17986 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17987 case EVENT_CastSpell:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17988 sub_448DF8_cast_spell(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17989 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17990 _evt->v6,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17991 _evt->v7,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17992 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17993 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17994 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17995 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17996 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
17997 _evt->v28 + ((_evt->v29 + ((_evt->v30 + ((uint)_evt->v31 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17998 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17999 case EVENT_SetTexture:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18000 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
18001 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18002 case EVENT_SetSprite:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18003 SetDecorationSprite(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18004 _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18005 _evt->v9,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18006 (char *)&_evt->v10);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18007 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18008 case EVENT_SummonMonsters:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18009 sub_448CF4_spawn_monsters(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18010 _evt->v5,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18011 _evt->v6,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18012 _evt->v7,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18013 _evt->v8 + ((_evt->v9 + ((_evt->v10 + ((uint)_evt->v11 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18014 _evt->v12 + ((_evt->v13 + ((_evt->v14 + ((uint)_evt->v15 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18015 _evt->v16 + ((_evt->v17 + ((_evt->v18 + ((uint)_evt->v19 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18016 _evt->v20 + ((_evt->v21 + ((_evt->v22 + ((uint)_evt->v23 << 8)) << 8)) << 8),
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18017 _evt->v24 + ((_evt->v25 + ((_evt->v26 + ((uint)_evt->v27 << 8)) << 8)) << 8));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18018 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18019 case EVENT_MouseOver:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18020 case EVENT_LocationName:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18021 --v122;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18022 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18023 case EVENT_ChangeDoorState:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18024 sub_449A49_door_switch_animation(_evt->v5, _evt->v6);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18025 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18026 case EVENT_OpenChest:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18027 if ( !Chest::Open(_evt->v5) )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18028 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18029 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18030 case EVENT_MoveToMap:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18031 v94 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18032 v135 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18033 v132 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18034 v126 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18035 v129 = _evt->v17 + ((_evt->v18 + ((_evt->v19 + ((uint)_evt->v20 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18036 v95 = _evt->v21 + ((_evt->v22 + ((_evt->v23 + ((uint)_evt->v24 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18037 v96 = _evt->v25;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18038 v97 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18039 v134 = v96 + ((_evt->v26 + ((_evt->v27 + ((uint)_evt->v28 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18040 if ( _evt->v29 || _evt->v30 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18042 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18043 pRenderer->_49FD3A();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18044 sub_444839_move_map(
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18045 _evt->v29,
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18046 _evt->v30,
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18047 v135,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18048 v132,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18049 v126,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18050 v129,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18051 v95,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18052 v134,
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18053 (char *)&_evt->v31);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18054 dword_5C3418 = uEventID;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18055 dword_5C341C = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18056 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18057 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18058 _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
18059 _5B65A8_npcdata_uflags_or_other = v94;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18060 _5B65B0_npcdata_rep_or_other = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18061 if ( v129 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18062 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18063 v98 = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18065 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18066 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18067 v98 = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18068 _5B65B4_npcdata_loword_house_or_other = v129 & stru_5C6E00->uDoublePiMask;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18069 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18070 v99 = (char *)&_evt->v31;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18071 _5B65B8_npcdata_hiword_house_or_other = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18072 dword_5B65BC = v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18073 v100 = v94 | v132 | v126 | v95 | v97 | v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18074 dword_5B65C0 = v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18075 if ( *v99 == 48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18077 if ( v100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18078 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18079 pParty->vPosition.x = v135;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18080 pParty->vPosition.y = v132;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18081 pParty->vPosition.z = v126;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18082 pParty->uFallStartY = v126;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18083 if ( _5B65B4_npcdata_loword_house_or_other != -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18084 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18085 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18086 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18087 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18088 v111 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18089 v110 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18090 v109 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18091 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18092 v107 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18093 pParty->sRotationX = v95;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18094 pParty->uFallSpeed = v134;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18095 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18096 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18097 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18098 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18099 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18100 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18101 v106 = 232;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18102 LABEL_280:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18103 pAudioPlayer->PlaySound((SoundID)v106, v107, v108, v109, v110, v111, v116, v120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18104 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18105 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18106 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18107 {
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18108 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)((_5C3420_pDecoration == 0) + 1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18109 sub_44987B(v99, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18110 v133 = 1;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
18111 if ( pCurrentScreen == 13 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18112 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18113 if ( uGameState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18115 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18116 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18117 while ( sub_4BD8B5() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18118 ;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18119 pVideoPlayer->Unload();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18120 ptr_507BC0->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18121 ptr_507BC0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18122 if ( pMessageQueue_50CBD0->uNumMessages )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18123 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
18124 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18125 viewparams->bRedrawGameUI = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18126 array_5913D8[6] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18127 pDialogueWindow->Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18128 dword_F8B19C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18129 pDialogueWindow = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18130 pIcons_LOD->_40F9C5();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18132 goto LABEL_302;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18135 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18136 case EVENT_PlaySound:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18137 v120 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18138 v116 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18139 v111 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18140 v110 = _evt->v13 + ((_evt->v14 + ((_evt->v15 + ((uint)_evt->v16 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18141 v109 = _evt->v9 + ((_evt->v10 + ((_evt->v11 + ((uint)_evt->v12 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18142 v108 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18143 v107 = 0;
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18144 v106 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18145 goto LABEL_280;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18146 case EVENT_GiveItem:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18147 item.Reset();
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18148 //v101 = &pSomeEVT[v9];
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18149 v102 = _evt->v7
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18150 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18151 pItemsTable->GenerateItem(_evt->v5, _evt->v6, &item);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18152 if ( v102 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18153 item.uItemID = v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18154 pParty->SetHoldingItem(&item);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18155 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18156 case EVENT_SpeakInHouse:
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18157 v103 = _evt->v5 + ((_evt->v6 + ((_evt->v7 + ((uint)_evt->v8 << 8)) << 8)) << 8);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18158 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
18159 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18160 if ( pRenderer->pRenderD3D && !pRenderer->bWindowMode )
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
18161 pRenderer->_49FD3A();
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18162 pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18163 pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18164 v104 = 187;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18165 if ( uCurrentHouse_Animation != 167 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18166 v104 = v103;
2
2ca04ccb612a NoCD, main menu, various
Nomad
parents: 1
diff changeset
18167 ptr_507BC0 = GUIWindow::Create(0, 0, 640, 480, WINDOW_HouseInterior, v104, 0);
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18168 ptr_507BC0->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18169 ptr_507BC0->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18170 ptr_507BC0->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18171 ptr_507BC0->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0);
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18172 ptr_507BC0->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18173 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18174 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18175 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18176 goto LABEL_291;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18177 case EVENT_PressAnyKey:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18178 v121 = 33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18179 v105 = v122 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18180 goto LABEL_295;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18181 case EVENT_Exit:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18182 goto LABEL_301;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18184 }
31
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18185 //++v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18186 //v124 = v4;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18187 //if ( v4 >= (signed int)uSomeEVT_NumEvents )
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18188 //goto LABEL_301;
f4450ff595fe BLV loading (looks like) done.
Nomad
parents: 29
diff changeset
18189 //}
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18191 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18193
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18194
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18195 //----- (0044861E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18196 void __fastcall sub_44861E_set_texture(unsigned int uFaceCog, const char *pFilename)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18198 unsigned int v2; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18199 unsigned __int16 v3; // di@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18200 signed int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18201 BLVFace *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18202 unsigned int *v6; // eax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18203 char *v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18204 int v8; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18205 char *v9; // esi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18206 ODMFace *v10; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18207 unsigned int *v11; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18208 unsigned __int16 v12; // [sp+Ch] [bp-18h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18209 const char *Str2; // [sp+10h] [bp-14h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18210 unsigned int v14; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18211 signed int v15; // [sp+18h] [bp-Ch]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18212 int v16; // [sp+1Ch] [bp-8h]@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18213 signed int v17; // [sp+20h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18214 signed int v18; // [sp+20h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18216 Str2 = pFilename;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18217 v14 = uFaceCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18218 if ( uFaceCog )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18219 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18220 v2 = pBitmaps_LOD->LoadTexture(pFilename);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18221 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18222 v12 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18223 if ( v2 != -1 ? (int)&pBitmaps_LOD->pTextures[v2] : 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18224 {
1
ac0fb48cd27a Texture, hwl loading, video player
Nomad
parents: 0
diff changeset
18225 pBitmaps_LOD->pTextures[v2].palette_id2 = pPaletteManager->LoadPalette(pBitmaps_LOD->pTextures[v2].palette_id1);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18227 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18229 v17 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18230 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18231 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18232 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18233 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18235 if ( pIndoor->pFaceExtras[v4].sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18236 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18237 v5 = &pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18238 if ( BYTE1(v5->uAttributes) & 0x40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18240 pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18241 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18242 v6 = (unsigned int *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uBitmapID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18243 if ( *(_WORD *)v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18245 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18247 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18249 *(_WORD *)v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18250 v7 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18251 v7[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18252 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18253 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18254 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18256 v5->uBitmapID = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18259 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18260 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18262 while ( v17 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18264 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18265 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18266 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18267 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18268 v15 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18269 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18270 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18271 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18272 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18274 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18275 v9 = (char *)&pOutdoor->pBModels[v16].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18276 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18277 if ( (signed int)pOutdoor->pBModels[v16].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18278 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18279 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18281 v10 = (ODMFace *)(v8 + *((_DWORD *)v9 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18282 if ( v10->sCogNumber == v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18283 {
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
18284 if ( BYTE1(v10->uAttributes) & 0x40 )
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18286 *(_WORD *)(*((_DWORD *)v9 + 4) + v8 + 272) = pTextureFrameTable->FindTextureByName(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18287 Str2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18288 v11 = (unsigned int *)(*((_DWORD *)v9 + 4) + v8 + 272);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18289 if ( *(_WORD *)v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18290 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18291 pTextureFrameTable->LoadAnimationSequenceAndPalettes(*(_WORD *)v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18292 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18293 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18294 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18295 *(_WORD *)v11 = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18296 *(_BYTE *)(*((_DWORD *)v9 + 4) + v8 + 29) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18297 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18298 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18299 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18301 v10->uTextureID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18302 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18303 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18304 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18305 v8 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18307 while ( v18 < *((_DWORD *)v9 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18309 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18310 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18311 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18312 while ( v15 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18313 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18314 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18315 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18316 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18318 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18319
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18320
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18321
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18322
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18323 //----- (0044882F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18324 void __fastcall SetDecorationSprite(unsigned int uCog, int a2, const char *pFileName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18326 signed int v3; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18327 char *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18328 unsigned __int16 v5; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18329 unsigned int v6; // [sp+4h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18330 int v7; // [sp+8h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18331
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18332 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18333 v7 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18334 v6 = uCog;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18335 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18336 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18337 v4 = (char *)&pLevelDecorations[0].field_2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18338 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18340 if ( *((_WORD *)v4 + 9) == v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18341 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18342 if ( pFileName && _strcmpi(pFileName, "0") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18343 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18344 v5 = pDecorationList->GetDecorIdByName(pFileName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18345 *((_WORD *)v4 - 1) = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18346 pDecorationList->InitializeDecorationSprite((signed __int16)v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18348 if ( v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18349 *v4 &= 0xDFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18350 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18351 *v4 |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18352 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18353 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18354 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18355 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18357 while ( v3 < (signed int)uNumLevelDecorations );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18358 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18359 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18360
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18361
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18362 //----- (004488B6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18363 unsigned __int16 DecorationList::GetDecorIdByName(const char *pName)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18365 DecorationList *v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18366 signed int uID; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18367 signed int v4; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18368 unsigned __int16 result; // ax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18369
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18370 v2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18371 if ( pName && (uID = 1, (signed int)this->uNumDecorations > 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18372 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18373 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18374 while ( _strcmpi(pName, v2->pDecorations[v4].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18376 ++uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18377 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18378 if ( uID >= (signed int)v2->uNumDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18379 goto LABEL_6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18380 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18381 result = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18383 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18384 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18385 LABEL_6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18386 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18387 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18388 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18389 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18390
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18391
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18392 //----- (0044892E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18393 void __fastcall sub_44892E_set_faces_bit(int sCogNumber, int bit, int on)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18394 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18395 signed int v3; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18396 signed int v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18397 char *v5; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18398 int v6; // edi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18399 char *v7; // esi@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18400 signed int v8; // ecx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18401 ODMFace *v9; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18402 int v10; // [sp+0h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18403 signed int v11; // [sp+4h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18404 int v12; // [sp+8h] [bp-4h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18405
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18406 v10 = sCogNumber;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18407 if ( sCogNumber )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18408 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18409 v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18410 if ( uCurrentlyLoadedLevelType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18412 if ( (signed int)pIndoor->uNumFaceExtras > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18414 v4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18415 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18417 if ( pIndoor->pFaceExtras[v4].sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18418 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18419 v5 = (char *)&pIndoor->pFaces[pIndoor->pFaceExtras[v4].field_C].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18420 if ( on )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18421 *(_DWORD *)v5 |= bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18422 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18423 *(_DWORD *)v5 &= ~bit;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18424 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18425 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18426 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18428 while ( v3 < (signed int)pIndoor->uNumFaceExtras );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18429 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18430 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18431 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18432 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18433 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18434 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18435 if ( (signed int)pOutdoor->uNumBModels > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18437 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18438 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18439 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18440 v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18441 v7 = (char *)&pOutdoor->pBModels[v12].pVertices;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18442 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18443 if ( (signed int)pOutdoor->pBModels[v12].uNumFaces > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18445 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18446 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18447 v9 = (ODMFace *)(v6 + *((_DWORD *)v7 + 4));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18448 if ( v9->sCogNumber == v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18450 if ( on )
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
18451 v9->uAttributes |= bit;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18452 else
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
18453 v9->uAttributes &= ~bit;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18455 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18456 v6 += 308;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18457 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18458 while ( v8 < *((_DWORD *)v7 + 2) );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18459 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18460 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18461 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18462 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18463 while ( v11 < (signed int)pOutdoor->uNumBModels );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18464 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18465 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18466 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18469
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18470
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18471 //----- (00448A17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18472 void Chest::ToggleFlag(unsigned int uChestID, unsigned __int16 uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18473 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18474 unsigned __int16 *pFlags; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18475
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18476 if ( (uChestID & 0x80000000u) == 0 && (signed int)uChestID <= 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18477 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18478 pFlags = &pChests[uChestID].uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18479 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18480 *pFlags |= uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18481 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18482 *pFlags &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18483 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18484 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18485
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18486 //----- (00448A40) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18487 void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18488 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18489 if ( uActorID >= 0 && uActorID <= (signed int)(uNumActors - 1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18490 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18491 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18493 pActors[uActorID].uAttributes |= uFlag;
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 if ( uFlag == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18498 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
18499 if (pActors[uActorID].uAIState == Disabled )
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
18500 pActors[uActorID].uAIState = Standing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18502 pActors[uActorID].uAttributes &= ~uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18506
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18507 //----- (00448A98) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18508 void __fastcall ToggleActorGroupFlag(unsigned int uGroupID, unsigned int uFlag, unsigned int bToggle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18509 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18510 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18511 unsigned int v4; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18512 signed int v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18513 char *v6; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18514 size_t v7; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18515 char *v8; // eax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18516 unsigned __int16 v9; // dx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18517
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18518 v4 = uGroupID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18519 v5 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18520 v3 = uFlag;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18521 if ( uGroupID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18522 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18523 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18525 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18526 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18527 v6 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18528 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18529 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18530 if ( *((_DWORD *)v6 + 168) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18532 *(_DWORD *)v6 |= v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18533 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18534 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18535 *((_WORD *)v6 + 70) = Disabled;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18536 ((Actor *)(v6 - 36))->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18537 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18539 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18540 v6 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18541 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18542 while ( v5 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18545 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18546 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18547 v7 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18548 if ( (signed int)uNumActors > Standing )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18550 v8 = (char *)&pActors[0].uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18551 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18553 if ( *((_DWORD *)v8 + 133) == v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18554 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18555 if ( v3 == 0x10000 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18556 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18557 v9 = *(_WORD *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18558 if ( *(_WORD *)v8 != Dead )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18559 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18560 if ( v9 != 4 && v9 != 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18561 *(_WORD *)v8 = Standing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18562 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18564 *((_DWORD *)v8 - 35) &= ~v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18566 v8 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18567 --v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18568 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18569 while ( v7 );
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 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18574
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18575
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18576 //----- (00448B45) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18577 void __thiscall GameUI_StatusBar_UpdateTimedString(unsigned int bForceHide)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18579 if ( bForceHide || GameUI_StatusBar_TimedStringTimeLeft && GetTickCount() >= GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18580 GameUI_StatusBar_TimedStringTimeLeft = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18581 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18582
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18583 //----- (00448B67) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18584 void __thiscall OnTimer(int a1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18585 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18586 int v1; // ebp@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18587 unsigned int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18588 unsigned int v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18589 char *v4; // esi@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18590 __int16 v5; // ax@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18591 int v6; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18592 unsigned int v7; // ebp@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18593 int v8; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18594 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18595 unsigned __int64 v10; // qax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18596 int v11; // ecx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18597 int v12; // [sp+Ch] [bp-10h]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18598 unsigned int v13; // [sp+10h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18599
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18600 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18601 if ( !pEventTimer->bPaused )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18602 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18603 if ( a1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18604 dword_5773C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18605 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18606 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18607 v13 = (signed __int64)(pParty->uTimePlayed - _5773B8_event_timer) / 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18608 if ( v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18610 _5773B8_event_timer = pParty->uTimePlayed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18611 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18612 if ( dword_5B65C8 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18613 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18614 v4 = (char *)&array_5B5928[0].field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18615 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18616 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18617 v5 = *(short *)v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18618 if ( *(short *)v4 != (short)v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18619 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18620 v7 = *((int *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18621 if ( v7 <= v3 && (v7 < v3 || *((int *)v4 - 3) <= v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18622 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18623 if ( *((short *)v4 + 2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18624 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18625 v8 = 29030400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18626 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18627 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18628 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18629 if ( *((short *)v4 + 3) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18630 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18631 v8 = 2419200;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18633 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18635 v9 = -(*((short *)v4 + 4) != 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18636 v8 = (v9 & 0x7E900) + 86400;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18637 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18638 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18639 v10 = __PAIR__(v7, *((int *)v4 - 3)) + (signed __int64)((double)((signed __int64)v8 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18640 *((int *)v4 - 3) = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18641 *((int *)v4 - 2) = HIDWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18642 if ( HIDWORD(v10) <= v3 && (HIDWORD(v10) < v3 || *((int *)v4 - 3) < v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18644 *((int *)v4 - 3) = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18645 *((int *)v4 - 2) = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18646 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18647 v11 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18648 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18649 EventProcessor(v11, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18650 dword_597F18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18651 LABEL_25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18652 v3 = HIDWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18653 v2 = LODWORD(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18654 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18655 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18656 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18657 v4 += 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18658 if ( v12 >= dword_5B65C8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18659 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18660 v1 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18661 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18662 if ( v13 < v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18664 *(short *)v4 = v5 - v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18665 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18667 v6 = *((short *)v4 - 2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18668 *(short *)v4 = *((short *)v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18669 dword_597F18 = *((short *)v4 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18670 EventProcessor(v6, 0, 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18671 dword_597F18 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18672 goto LABEL_25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18674 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18675 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18676 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18677
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18678 //----- (00481D77) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18679 void _outdoor_project(RenderVertexSoft *v)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18681 double v1; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18682 double v2; // st7@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18683
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18684 v1 = 1.0 / (v->vWorldViewPosition.x + 0.0000001);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18685 v->flt_20 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18686 v2 = v1 * (double)pOutdoorCamera->int_fov_rad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18687 v->vWorldViewProjX = (double)pViewport->uScreenCenterX - v2 * v->vWorldViewPosition.y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18688 v->vWorldViewProjY = (double)pViewport->uScreenCenterY - v2 * v->vWorldViewPosition.z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18690
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18691
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18692 //----- (00448CF4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18693 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
18694 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18695 __int16 v8; // di@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18696 __int16 v9; // si@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18697 unsigned int v10; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18698 size_t v11; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18699 signed int v12; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18700 char *v13;//Actor_uYawAngle_cr *v13; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18701 AIDirection a3; // [sp+Ch] [bp-50h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18702 AIDirection v15; // [sp+28h] [bp-34h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18703 //SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18704
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18705 v8 = typeindex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18706 v9 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18707
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18708 SpawnPointMM7 v16; // [sp+44h] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18709 //SpawnPointMM7::SpawnPointMM7(&v16);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18710
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18711 v16.vPosition.x = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18712 v16.vPosition.y = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18713 v16.vPosition.z = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18714 v16.uGroup = group;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18715 v16.uRadius = 32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18716 v16.uKind = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18717 v16.uIndex = v8 + 2 * v9 + v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18718 v10 = pMapStats->GetMapInfo(pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18719 if ( v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18721 v11 = uNumActors;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18722 SpawnEncounter((MapInfo *)&pMapStats + v10, &v16, 0, count, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18723 memcpy(&v15, Actor::GetDirectionInfo(8 * v11 | AI_OBJECT_ACTOR, 4u, &a3, 1), sizeof(v15));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18724 v12 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18725 if ( (signed int)v11 < (signed int)uNumActors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18726 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18727 v13 = (char *)&pActors[v11].uYawAngle;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18728 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18729 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18730 ((Actor *)((char *)v13 - 154))->PrepareSprites(0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18731 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18732 *(short *)v13/*->uYawAngle*/ = LOWORD(v15.uYawAngle);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18733 *(int *)(v13+666)/*->dword_000334_unique_name*/ = uUniqueName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18734 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18735 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18736 while ( v12 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18738 }
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 //----- (00448DF8) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18743 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
18744 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18745 int v9; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18746 double v10; // st7@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18747 double v11; // st6@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18748 double v12; // st5@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18749 double v13; // st7@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18750 int v14; // ST44_4@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18751 signed int v15; // ebx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18752 signed int v16; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18753 char *v17; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18754 unsigned __int16 v18; // ax@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18755 char *v19; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18756 int v20; // edx@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18757 signed int v21; // edx@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18758 char *v22; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18759 unsigned __int16 v23; // ax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18760 int i; // esi@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18761 signed int v25; // edx@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18762 char *v26; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18763 unsigned __int16 v27; // ax@59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18764 int j; // esi@60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18765 signed int v29; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18766 char *v30; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18767 unsigned __int16 v31; // ax@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18768 char *v32; // eax@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18769 unsigned __int16 v33; // si@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18770 int v34; // eax@96
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18771 int v35; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18772 unsigned __int64 v36; // qax@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18773 SpellBuff *v37; // ecx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18774 int v38; // esi@103
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18775 signed __int64 v39; // qax@105
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18776 int v40; // ebx@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18777 int v41; // ebx@109
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18778 int v42; // esi@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18779 int v43; // ebx@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18780 int v44; // eax@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18781 unsigned __int16 v45; // si@137
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18782 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18783 int v47; // [sp-4h] [bp-B8h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18784 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18785 int v49; // [sp+0h] [bp-B4h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18786 int v50; // [sp+0h] [bp-B4h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18787 int v51; // [sp+4h] [bp-B0h]@35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18788 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18789 float v53; // [sp+14h] [bp-A0h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18790 float v54; // [sp+18h] [bp-9Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18791 int v55; // [sp+28h] [bp-8Ch]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18792 unsigned int yaw; // [sp+30h] [bp-84h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18793 int pitch; // [sp+34h] [bp-80h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18794 //LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18795 int v59; // [sp+A8h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18796 int v60; // [sp+ACh] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18797 int spellnum_; // [sp+B0h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18798 signed int levela; // [sp+BCh] [bp+8h]@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18799 int a6_4; // [sp+C8h] [bp+14h]@117
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18800 float a7a; // [sp+CCh] [bp+18h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18801 signed int a7b; // [sp+CCh] [bp+18h]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18802 int a7c; // [sp+CCh] [bp+18h]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18803 int a7d; // [sp+CCh] [bp+18h]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18804 float a8a; // [sp+D0h] [bp+1Ch]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18805 int a8b; // [sp+D0h] [bp+1Ch]@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18806 int a8c; // [sp+D0h] [bp+1Ch]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18807 float toza; // [sp+D4h] [bp+20h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18808
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18809 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18810 v59 = rank + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18811 spellnum_ = spellnum;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18812 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18813 if ( tox || toy || toz )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18814 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18815 v10 = (double)tox - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18816 v53 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18817 v11 = (double)toy - (double)fromy;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18818 v54 = v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18819 v12 = (double)toz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18820 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18821 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18822 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18823 v10 = (double)pParty->vPosition.x - (double)fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18824 v53 = v10;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18825 v11 = (double)pParty->vPosition.y - (double)fromy;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18826 v54 = v11;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
18827 v12 = (double)(pParty->vPosition.z + pParty->sEyelevel);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18829 a7a = v12 - (double)fromz;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18830 toza = v11 * v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18831 a8a = v10 * v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18832 v13 = sqrt(a7a * a7a + a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18833 if ( v13 <= 1.0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18835 LOBYTE(v55) = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18836 yaw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18837 pitch = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18839 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18840 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18841 v55 = (signed __int64)v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18842 v14 = (signed __int64)sqrt(a8a + toza);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18843 yaw = stru_5C6E00->Atan2((signed __int64)v53, (signed __int64)v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18844 pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18845 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18846 v15 = v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18847 if ( v59 <= 0 || v59 > 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18848 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18849 a7b = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18850
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18851 LayingItem a1; // [sp+38h] [bp-7Ch]@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18852 //LayingItem::LayingItem(&a1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18853
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18854 a1.uItemType = stru_4E3ACC[spellnum_].uItemType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18855 if ( spellnum_ > 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18857 if ( spellnum_ == 69 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18858 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18859 if ( spellnum_ != 83 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18860 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18861 v40 = v15 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18862 if ( v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18863 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18864 v41 = v40 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18865 if ( !v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18866 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18867 v42 = 14400 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18868 v43 = 4 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18869 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18870 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18871 if ( v41 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18872 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18873 v42 = 18000 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18874 v43 = 5 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18875 goto LABEL_114;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18878 v42 = 10800 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18879 v43 = 3 * level + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18880 LABEL_114:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18881 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18882 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18883 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18884 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18885 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18886 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18887 v48 = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18888 v46 = a7b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18889 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18890 v37 = &pParty->pPartyBuffs[2];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18891 LABEL_115:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18892 v36 = pParty->uTimePlayed + v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18893 LABEL_116:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18894 v37->Apply(v36, v46, v48, v50, v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18895 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18896 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18897 if ( spellnum_ != 58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18899 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18900 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18901 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18902 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18903 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18904 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18905 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18906 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18907 case 39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18908 case 41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18909 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18910 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18911 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18912 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18913 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18914 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18915 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18916 v17 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18917 while ( (short)a1.uItemType != *(short *)v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18918 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18919 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18920 v17 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18921 if ( v16 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18922 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18923 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18924 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18925 v18 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18926 goto LABEL_35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18927 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18928 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18929 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18930 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18931 v60 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18932 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18933 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18934 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18935 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18936 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18937 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18938 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18939 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18940 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18941 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18942 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18943 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18944 if ( v60 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18946 a8b = a7c / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18947 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18948 v21 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18949 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18950 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18951 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18952 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18954 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18955 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18957 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18958 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18959 v22 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18960 while ( (short)a1.uItemType != *(short *)v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18962 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18963 v22 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18964 if ( v21 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18965 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18966 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18967 v23 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18968 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18969 a1.uObjectDescID = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18970 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18971 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18972 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18973 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18974 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18975 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18976 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18977 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18978 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18979 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18980 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18981 a1.uFacing = i + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18982 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18983 (signed __int16)(i + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18984 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18985 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18986 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18987 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18988 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18989 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18990 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18991 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18992 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18993 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18994 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18995 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18996 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18997 v19 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18998 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18999 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19000 if ( (short)a1.uItemType == *(short *)v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19001 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19002 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19003 v19 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19005 while ( v16 < (signed int)pObjectList->uNumObjects );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19006 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19007 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19008 LABEL_35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19009 a1.uObjectDescID = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19010 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19011 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19012 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19013 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19014 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19015 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19016 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19017 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19018 a1.field_5C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19019 a1.uFacing = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19020 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19021 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19022 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19023 v47 = pitch;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19024 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19025 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19026 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19028 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19029 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19030 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19031 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19032 v60 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19033 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19034 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19035 v60 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19036 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19037 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19038 v60 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19039 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19040 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19041 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19042 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19043 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19044 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19045 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19046 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19047 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19048 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19049 goto LABEL_59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19050 v26 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19051 while ( (short)a1.uItemType != *(short *)v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19052 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19053 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19054 v26 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19055 if ( v25 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19056 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19057 LABEL_59:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19058 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19059 goto LABEL_60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19062 v27 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19063 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19064 a1.uObjectDescID = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19065 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19066 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19067 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19068 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19069 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19070 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19071 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19072 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19073 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19074 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19075 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19076 a1.uFacing = j + yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19077 a1.Create(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19078 (signed __int16)(j + (short)yaw),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19079 pitch,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19080 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19081 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19082 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19083 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19084 case 43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19085 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19086 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19087 a1.stru_24.Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19088 v29 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19089 a1.field_48 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19090 a1.field_4C = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19091 a1.field_50 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19092 if ( (signed int)pObjectList->uNumObjects <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19093 goto LABEL_70;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19094 v30 = (char *)&pObjectList->pObjects->uObjectID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19095 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19096 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19097 if ( v15 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19098 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19099 if ( v15 <= 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19100 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19101 v9 = 60 * (level + 60);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19102 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19103 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19105 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19107 v9 = 180 * (level + 20);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19108 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19109 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19111 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19112 v9 = 240 * (level + 15);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19113 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19115 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19116 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19117 v32 = (char *)&pParty->pPlayers[0].pConditions[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19118 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19119 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19120 if ( *(_QWORD *)v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19121 levela = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19122 v32 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19123 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19124 while ( (signed int)v32 < (signed int)&pParty->pHirelings[0].uFlags );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19125 if ( !levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19126 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19127 pParty->pPartyBuffs[8].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19128 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19129 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19130 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19131 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19132 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19133 v33 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19134 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19135 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19136 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19137 pGame->pStru6Instance->SetPlayerBuffAnim(v33, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19138 goto LABEL_138;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19139 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19140 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19141 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19142 switch ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19144 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19145 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19146 v9 = 300 * (level + 12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19147 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19148 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19149 v9 = 900 * (level + 4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19150 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19151 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19152 v9 = 3600 * (level + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19153 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19155 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19157 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19158 v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19159 level = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19160 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19161 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19162 v35 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19163 level = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19164 v60 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19165 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19166 case 51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19167 v34 = level + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19168 level = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19169 v60 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19170 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19172 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19173 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19174 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19175 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19176 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19177 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19178 v48 = v60;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19179 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19180 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19181 v37 = &pParty->pPartyBuffs[level];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19182 goto LABEL_116;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19183 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19184 if ( v15 == 2 || v15 == 3 || v15 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19185 v38 = 60 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19186 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19187 v38 = 600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19188 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19189 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19190 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19191 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19192 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19193 v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19194 v48 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19195 v46 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19196 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19197 v37 = &pParty->pPartyBuffs[10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19198 goto LABEL_115;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19199 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19200 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19201 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19202 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19203 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19204 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19205 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19206 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19207 while ( (short)a1.uItemType != *(short *)v30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19208 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19209 ++v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19210 v30 += 56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19211 if ( v29 >= (signed int)pObjectList->uNumObjects )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19212 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19213 LABEL_70:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19214 v31 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19215 goto LABEL_71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19216 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19217 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19218 v31 = v29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19219 LABEL_71:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19220 a1.uObjectDescID = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19221 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19222 a1.vPosition.x = fromx;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19223 a1.uAttributes = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19224 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19225 a1.field_60_distance_related_prolly_lod = v55;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19226 a1.uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19227 a1.field_58 = 8002;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19228 a1.field_5C = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19229 a1.uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19230 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19231 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19232 v20 = yaw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19233 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19234 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19235 a1.Create(v20, v47, v49, v51);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19236 goto LABEL_139;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19237 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19238 LABEL_117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19239 v44 = level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19240 a6_4 = 3600 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19241 if ( v15 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19243 LABEL_124:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19244 v60 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19245 goto LABEL_125;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19246 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19247 if ( v15 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19248 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19249 v44 = 2 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19250 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19251 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19252 if ( v15 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19253 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19254 v44 = 3 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19255 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19257 if ( v15 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19258 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19259 v44 = 4 * level;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19260 goto LABEL_124;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19262 LABEL_125:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19263 switch ( spellnum_ )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19265 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19266 level = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19267 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19268 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19269 level = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19270 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19271 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19272 level = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19273 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19274 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19275 level = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19276 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19277 case 58:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19278 level = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19279 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19280 case 69:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19281 level = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19282 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19284 v45 = spellnum_;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19285 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum_, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19286 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19287 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 2u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19288 pGame->pStru6Instance->SetPlayerBuffAnim(v45, 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19289 pParty->pPartyBuffs[level].Apply(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19290 pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19291 v15,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19292 v60,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19293 0,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19294 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19295 levela = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19296 LABEL_138:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19297 if ( levela )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19298 LABEL_139:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19299 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum_], 0, 0, fromx, fromy, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19300 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19301 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19302
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19303 //----- (0044987B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19304 char *__fastcall sub_44987B(const char *pMapName, unsigned int uStartingPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19305 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19306 const char *v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19307 unsigned int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19308 char *result; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19309
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19310 v2 = pMapName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19311 v3 = uStartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19312 pAudioPlayer->StopChannels(-1, -1);
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19313 pGameLoadingUI_ProgressBar->_443484((GUIProgressBar::Type)0);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19314 if ( _strcmpi(pCurrentMapName, v2) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19315 SaveGame(1, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19316 uGameState = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19317 result = strcpy(pCurrentMapName, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19318 uLevel_StartingPointType = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19319 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19321 // 6BE35C: using guessed type int uLevel_StartingPointType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19322
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19323 //----- (004498D5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19324 void __thiscall TeleportToStartingPoint(unsigned int uPointType)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19325 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19326 unsigned int v1; // ecx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19327 int v2; // ecx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19328 int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19329 unsigned __int16 v4; // ax@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19330 signed int v5; // ecx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19331 LevelDecoration *v6; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19332 signed int v7; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19333 int v8; // eax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19334 int v9; // ecx@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19335 const char *v10; // [sp-4h] [bp-84h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19336 char pName[128]; // [sp+8h] [bp-78h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19337
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19338 if ( uPointType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19339 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19340 v1 = uPointType - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19341 if ( v1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19342 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19343 v2 = v1 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19344 if ( v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19345 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19346 v3 = v2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19347 if ( v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19348 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19349 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19350 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19351 v10 = "West Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19352 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19353 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19355 v10 = "East Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19356 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19357 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19358 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19359 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19360 v10 = "South Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19361 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19362 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19363 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19364 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19365 v10 = "North Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19366 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19367 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19368 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19369 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19370 v10 = "Party Start";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19371 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19372 strcpy(pName, v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19373 v4 = pDecorationList->GetDecorIdByName(pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19374 if ( v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19375 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19376 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19377 if ( (signed int)uNumLevelDecorations > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19378 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19379 v6 = pLevelDecorations;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19380 while ( v6->uDecorationDescID != (signed __int16)v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19381 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19382 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19383 ++v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19384 if ( v5 >= (signed int)uNumLevelDecorations )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19385 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19386 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19387 v7 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19388 pParty->vPosition.x = pLevelDecorations[v7].vPosition.x;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19389 pParty->vPosition.y = pLevelDecorations[v7].vPosition.y;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19390 pParty->vPosition.z = pLevelDecorations[v7].vPosition.z;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19391 pParty->uFallStartY = pParty->vPosition.z;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19392 v8 = (signed int)(stru_5C6E00->uIntegerHalfPi * pLevelDecorations[v7].field_1A) / 90;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19393 v9 = pLevelDecorations[v7].field_10_y_rot;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19394 pParty->sRotationY = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19395 if ( v9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19396 pParty->sRotationY = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19397 pParty->sRotationX = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19398 pParty->uFallSpeed = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19400 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19401 if ( dword_5B65C0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19403 if ( _5B65A8_npcdata_uflags_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19404 pParty->vPosition.x = _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19405 if ( _5B65AC_npcdata_fame_or_other )
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19406 pParty->vPosition.y = _5B65AC_npcdata_fame_or_other;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19407 if ( _5B65B0_npcdata_rep_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19408 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19409 pParty->vPosition.z = _5B65B0_npcdata_rep_or_other;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19410 pParty->uFallStartY = _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19411 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19412 if ( _5B65B4_npcdata_loword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19413 pParty->sRotationY = _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19414 if ( _5B65B8_npcdata_hiword_house_or_other )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19415 pParty->sRotationX = _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19416 if ( dword_5B65BC )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19417 pParty->uFallSpeed = dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19418 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19419 _5B65B4_npcdata_loword_house_or_other = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19420 dword_5B65C0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19421 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19422 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19423 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19424 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19425 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19426 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19428 // 5B65A8: using guessed type int _5B65A8_npcdata_uflags_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19429 // 5B65AC: using guessed type int _5B65AC_npcdata_fame_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19430 // 5B65B0: using guessed type int _5B65B0_npcdata_rep_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19431 // 5B65B4: using guessed type int _5B65B4_npcdata_loword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19432 // 5B65B8: using guessed type int _5B65B8_npcdata_hiword_house_or_other;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19433 // 5B65BC: using guessed type int dword_5B65BC;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19434 // 5B65C0: using guessed type int dword_5B65C0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19435
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19436 //----- (00449A49) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19437 __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19439 int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19440 int v3; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19441 signed int v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19442 int v5; // edx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19443 BLVDoor *v6; // ecx@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19444 unsigned int v7; // edx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19445 signed int v8; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19446 int v9; // eax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19447 char Args; // [sp+Ch] [bp-78h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19448
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19449 LOWORD(v2) = LOWORD(pIndoor->pDoors);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19450 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19451 if ( !pIndoor->pDoors )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19452 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19453 v4 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19454 v5 = (int)&pIndoor->pDoors->uDoorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19455 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19457 if ( *(int *)v5 == uDoorID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19458 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19459 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19460 v5 += 80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19461 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19462 while ( v4 < 200 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19463 if ( v4 >= 200 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19465 sprintfex(&Args, "Unable to find Door ID: %i!", uDoorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19466 Abortf(&Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19467 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19468 v6 = &pIndoor->pDoors[v4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19469 if ( v3 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19470 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19471 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19472 if ( (short)v2 == 3 || (short)v2 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19473 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19474 if ( (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19475 goto LABEL_14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19476 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19477 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19479 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19480 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19481 LABEL_14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19482 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19483 if ( (short)v2 && (short)v2 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19484 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
19485 v6->uState = BLVDoor::Closing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19486 if ( (short)v2 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19487 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19488 LABEL_17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19489 v6->uTimeSinceTriggered = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19490 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19491 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19492 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19493 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19494 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19495 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19496 v8 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19497 v9 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19498 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19499 v2 = (v6->uMoveLength << 7) / v8 - ((signed int)(v7 * v9) / 128 << 7) / v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19500 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19501 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19502 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19503 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19504 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19505 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19506 if ( v3 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19507 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19508 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19509 LOWORD(v2) = v6->uState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19510 if ( (short)v2 != 2 && (short)v2 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19511 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
19512 v6->uState = BLVDoor::Opening;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19513 if ( !(short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19514 goto LABEL_17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19515 v7 = v6->uTimeSinceTriggered;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19516 v2 = 15360;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19517 if ( v7 != 15360 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19519 v8 = v6->uCloseSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19520 v9 = v6->uOpenSpeed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19521 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19523 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19524 v6->uTimeSinceTriggered = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19525 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19526 return v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19527 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19528
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19529 //----- (00449B57) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19530 unsigned int __fastcall _449B57_test_bit(unsigned __int8 *a1, __int16 a2)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19531 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19532 return a1[(a2 - 1) >> 3] & (0x80u >> (a2 - 1) % 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19533 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19534
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19535 //----- (00449B7E) --------------------------------------------------------
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19536 unsigned char *_449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19537 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19538 signed int v3; // esi@1
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19539 unsigned char *result; // eax@1
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19540 unsigned int v5; // edx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19541
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19542 v3 = a2 - 1;
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19543 result = &pArray[v3 / 8];
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19544 v5 = 0x80 >> v3 % 8;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19545 if ( bToggle )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19546 *result |= v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19547 else
26
93bf1d5f6a6d Game loading.
Nomad
parents: 23
diff changeset
19548 *result &= ~(unsigned char)v5;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19549 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19551
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19552
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19553 //----- (0044A56A) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19554 void __cdecl sub_44A56A()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19555 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19556 signed int v0; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19557 NPCData *v1; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19558
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19559 pParty->field_70A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19560 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19561 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19562 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19563 v1 = pNPCStats->pNewNPCData;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19564 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19565 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19566 if ( v1->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v1->pName, pParty->pHirelings[0].pName)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19567 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19568 if ( !pParty->pHirelings[1].pName || strcmp(v1->pName, pParty->pHirelings[1].pName) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19569 ++pParty->field_70A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19570 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19571 ++v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19572 ++v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19573 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19574 while ( v0 < (signed int)pNPCStats->uNumNewNPCs );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19575 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19576 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19577
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19578
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19579 //----- (0044C175) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19580 void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19581 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19582 unsigned int v2; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19583 int i; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19584
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19585 v2 = uNumSeconds;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19586 strcpy(GameUI_StatusBar_TimedString, pString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19587 GameUI_StatusBar_TimedStringTimeLeft = 1000 * v2 + GetTickCount();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19588 for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19589 i > 450;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19590 i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19591 byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19592 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19593
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19594 //----- (0044C1D0) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19595 void __cdecl ShowNothingHereStatus()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19596 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19597 if ( !GameUI_StatusBar_TimedStringTimeLeft )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19598 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19599 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19600
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19601
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19602 //----- (0044C28B) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19603 signed int __cdecl const_2()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19604 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19605 return 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19606 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19607
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19608 //----- (0044C28F) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19609 bool __cdecl sub_44C28F_open_nwc_dungeon()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19611 bool result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19612
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19613 result = _strcmpi("nwc.blv", pCurrentMapName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19614 if ( result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19616 _5B65A8_npcdata_uflags_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19617 _5B65AC_npcdata_fame_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19618 _5B65B0_npcdata_rep_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19619 _5B65B4_npcdata_loword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19620 _5B65B8_npcdata_hiword_house_or_other = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19621 dword_5B65BC = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19622 dword_5B65C0 = 0;
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19623 pGameLoadingUI_ProgressBar->uType = GUIProgressBar::TYPE_Fullscreen;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19624 sub_44987B("nwc.blv", 0);
44
916bec351934 22.10.12(pCurrentScreen)
Ritor1
parents: 31
diff changeset
19625 pCurrentScreen = 0;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19626 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19627 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19628 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19629 }
27
be2066176d89 On level initialization
Nomad
parents: 26
diff changeset
19630
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19631
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19632 //----- (0044C2F4) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19633 int LevelDecoration::IsInteractive()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19634 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19635 signed int v1; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19636
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19637 v1 = this->uDecorationDescID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19638 if ( v1 > 34 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19640 if ( v1 == 184 || v1 == 187 || v1 == 190 || v1 > 205 && v1 <= 221 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19641 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19642 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19643 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19644 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19645 if ( v1 == 34 || v1 >= 4 && (v1 <= 6 || v1 == 11 || v1 > 12 && (v1 <= 14 || v1 == 24)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19646 return 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19647 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19648 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19649 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19650
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19651 //----- (0044C362) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19652 void Vec3_int_::Normalize_float()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19654 Vec3_int_ *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19655 double v2; // st6@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19656 float v3; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19657 double v4; // st5@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19658 float v5; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19659 double v6; // st4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19660 float v7; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19661 float v8; // ST24_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19662 float v9; // ST20_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19663 double v10; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19664 float v11; // ST18_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19665 double v12; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19666 float v13; // ST14_4@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19667 double v14; // ST0C_8@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19668
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19669 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19670 v2 = (double)this->x * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19671 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19672 v4 = (double)this->y * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19673 v5 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19674 v6 = (double)this->z * 0.000015258789;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19675 v7 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19676 v8 = 1.0 / sqrt(v6 * v6 + v4 * v4 + v2 * v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19677 v9 = v8 * v3 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19678 v10 = v9 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19679 v1->x = LODWORD(v10);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19680 v11 = v8 * v5 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19681 v12 = v11 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19682 v1->y = LODWORD(v12);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19683 v13 = v8 * v7 * 65536.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19684 v14 = v13 + 6.7553994e15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19685 v1->z = LODWORD(v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19686 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19687
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19688 //----- (0044C448) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19689 GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19691 GUIFont *result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19692 const char *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19693 const char **v4; // ebx@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19694 unsigned int v5; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19695 unsigned __int16 **v6; // ecx@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19696 GUIFont *v7; // [sp+4h] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19697 int v8; // [sp+8h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19698 unsigned __int16 **v9; // [sp+Ch] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19699
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19700 result = (GUIFont *)pIcons_LOD->LoadRaw(pFontFile, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19701 v3 = pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19702 v8 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19703 v7 = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19704 if ( pFontPalette )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19706 v4 = &pFontPalette;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19707 v9 = result->pFontPalettes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19708 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19709 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19710 v5 = pIcons_LOD->LoadTexture(v3, TEXTURE_16BIT_PALETTE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19711 if ( v5 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19712 {
3
540178ef9b18 Main menu functionality
Nomad
parents: 2
diff changeset
19713 sprintf(pTmpBuf, "Unable to open %s", v3);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19714 Abortf(pTmpBuf);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19715 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19716 ++v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19717 v6 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19718 v3 = *v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19719 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19720 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19721 *v6 = (v5 != -1 ? pIcons_LOD->pTextures[v5].pPalette16 : 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19722 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19723 while ( v3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19724 result = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19725 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19726 result->field_8 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19727 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19729
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19730
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19731
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19732
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19733 //----- (0044C768) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19734 char *__fastcall FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, unsigned int uX, int a5)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19736 const char *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19737 GUIFont *v6; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19738 unsigned int v8; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19739 int v9; // edi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19740 unsigned __int8 v10; // cl@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19741 int v11; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19742 GUICharMetric *v12; // ecx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19743 int v13; // edx@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19744 int v14; // edx@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19745 int v15; // edx@13
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19746 unsigned int v16; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19747 unsigned int v17; // edx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19748 unsigned int v18; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19749 int v19; // ebx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19750 unsigned __int8 v20; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19751 char v21; // sf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19752 unsigned __int8 v22; // of@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19753 int v23; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19754 unsigned __int8 v24; // dl@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19755 int v25; // edi@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19756 int v26; // eax@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19757 std::string v27; // [sp-18h] [bp-40h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19758 const char *v28; // [sp-8h] [bp-30h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19759 int v29; // [sp-4h] [bp-2Ch]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19760 const char *v30; // [sp+Ch] [bp-1Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19761 char Str[3]; // [sp+10h] [bp-18h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19762 char v32; // [sp+13h] [bp-15h]@42
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19763 size_t v33; // [sp+14h] [bp-14h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19764 unsigned int v34; // [sp+18h] [bp-10h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19765 GUIFont *v35; // [sp+1Ch] [bp-Ch]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19766 int v36; // [sp+20h] [bp-8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19767 int v37; // [sp+24h] [bp-4h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19768
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19769 v5 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19770 v6 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19771 v30 = pInString;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19772 v35 = pFont;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19773 if ( !pInString )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19774 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19775 MessageBoxW(nullptr, L"Invalid string passed !", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:445", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19776 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19778 v33 = strlen(pInString);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19779 strcpy(pTmpBuf3, v5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19780 v8 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19781 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19782 v36 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19783 v34 = uX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19784 v37 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19785 if ( (signed int)v33 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19787 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19788 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19789 v10 = pTmpBuf3[v9];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19790 if ((v10 < v6->cFirstChar || v10 > v6->cLastChar)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19791 && v10 != '\f' && v10 != '\r' && v10 != '\t' && v10 != '\n' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19792 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19793 v11 = v10 - 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19794 v12 = &v6->pMetrics[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19795 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19796 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19797 strncpy(Str, &pTmpBuf3[v9 + 1], 3u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19798 v32 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19799 v26 = atoi(Str);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19800 v8 = uX + v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19801 v25 = v9 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19802 v34 = v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19803 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19805 v13 = v11 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19806 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19807 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19808 v14 = v13 - 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19809 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19810 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19811 v25 = v9 + 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19812 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19813 v37 = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19814 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19815 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19816 v15 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19817 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19818 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19819 if ( v15 != 19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19820 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19821 v16 = v12->uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19822 v17 = v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19823 v18 = v12->uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19824 if ( v8 + v16 + v18 + v17 < pWindow->uFrameWidth )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19825 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19826 if ( v37 > v36 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19827 v8 += v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19828 v8 += v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19829 if ( v37 < (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19830 v8 += v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19831 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19832 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19833 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19834 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19835 v19 = v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19836 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19837 v22 = __OFSUB__(v36, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19838 v20 = v36 == v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19839 v21 = v36 - v37 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19840 v6 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19841 pTmpBuf3[v36] = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19842 v23 = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19843 if ( (unsigned __int8)(v21 ^ v22) | v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19844 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19845 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19847 v24 = pTmpBuf3[v23];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19848 if ( v24 >= v6->cFirstChar && v24 <= v6->cLastChar || v24 == 12 || v24 == 13 || v24 == 9 || v24 == 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19849 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19850 if ( v23 > v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19851 v8 += v6->pMetrics[v24].uLeftSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19852 v8 += *((int *)&v6->cFirstChar + 3 * v24 + 9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19853 if ( v23 < v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19854 v8 += v6->pMetrics[v24].uRightSpacing;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19855 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19856 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19857 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19858 while ( v23 <= v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19860 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19861 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19862 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19863 v8 += v12->uWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19864 goto LABEL_41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19865 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19866 if ( !a5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19867 return (char *)v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19868 LABEL_34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19869 v9 = v37++ + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19870 if ( v37 >= (signed int)v33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19871 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19872 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19873 v8 = v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19874 LABEL_41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19875 v36 = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19876 goto LABEL_34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19877 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19878 return pTmpBuf3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19879 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19880
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19881
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19882
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19883
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19884
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19885
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19886
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19887
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19888
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19889
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19890
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19891 //----- (00401000) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19892 void __stdcall mm7__vector_constructor(void *a1, int objSize, int numObjs, int (__thiscall *constructor)(int))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19894 void *v4; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19895 int v5; // edi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19896
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19897 if ( numObjs - 1 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19898 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19899 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19900 v5 = numObjs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19901 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19902 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19903 constructor((int)v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19904 v4 = (char *)v4 + objSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19905 --v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19907 while ( v5 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19908 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19909 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19910
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19911
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19912 //----- (004014E6) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19913 int __cdecl ODM_4014E6_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19914 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19915 int v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19916 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19917 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19918 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19919 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19920 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19921 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19922 unsigned int v7; // ST20_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19923 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19924 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19925 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19926 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19927 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19928 int result; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19929 int v14; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19930 int v15; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19931 int v16; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19932 unsigned int *v17; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19933 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19934 int i; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19935 char *v20; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19936 int v21; // [sp+Ch] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19937 int v22; // [sp+10h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19938 int v23; // [sp+14h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19939 int v24; // [sp+14h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19940 signed int v25; // [sp+18h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19941 signed int v26; // [sp+18h] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19942 int v27; // [sp+1Ch] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19943
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19944 pParty->uFlags &= 0xFFFFFFCFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19945 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19946 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19947 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19948 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19949 v0 = (int)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19950 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19952 *(char *)(v0 + 1) &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19953 if ( ! ((Actor *)(v0 - offsetof(Actor, uAttributes)))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19954 goto LABEL_37;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19955 v22 = abs(pParty->vPosition.z - *(short *)(v0 + 110));
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
19956 v21 = abs(pParty->vPosition.y - *(short *)(v0 + 108));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19957 v1 = abs(pParty->vPosition.x - *(short *)(v0 + 106));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19958 v2 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19959 v3 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19960 if ( v1 < v21 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19961 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19962 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19963 v1 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19964 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19965 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19966 if ( v1 < v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19967 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19968 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19969 v1 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19970 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19972 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19973 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19974 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19975 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19976 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19977 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19978 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19979 v8 = *(short *)(v0 + 100);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19980 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19981 v23 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19982 if ( v23 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19983 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19984 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19985 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19986 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19987 if ( v9 < 5632 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19988 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19989 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19990 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19991 if ( v10 & 0x80000 || ((Actor *)(v0 - offsetof(Actor, uAttributes)))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19993 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19994 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19995 if ( v11 && (double)v23 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19996 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19997 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19998 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19999 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20000 *(char *)(v0 + 1) |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20001 v12 = v27++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20002 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20003 ai_array_4F7DB0_actor_ids[v12] = v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20004 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20005 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20006 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20007 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20008 *(char *)(v0 + 1) &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20009 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20010 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20011 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20012 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20013 while ( v25 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20015 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20016 if ( v27 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20017 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20018 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20019 v15 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20020 v26 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20021 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20022 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20023 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20024 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20025 v24 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20026 if ( v15 >= result )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20027 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20028 v16 = ai_array_4F75E0[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20029 if ( v16 > ai_array_4F75E0[v15] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20030 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20031 v17 = &ai_array_4F7DB0_actor_ids[v15];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20032 v18 = ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20033 ai_array_4F7DB0_actor_ids[v14] = *v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20034 *v17 = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20035 v15 = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20036 ai_array_4F75E0[v14] = ai_array_4F75E0[v24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20037 ai_array_4F75E0[v24] = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20038 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20039 result = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20040 ++v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20041 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20042 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20043 v15 = v26 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20044 v26 = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20045 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20046 while ( v15 - 1 < result );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20047 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20048 ai_arrays_size = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20049 if ( result > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20050 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20051 result = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20052 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20053 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20054 for ( i = 0; i < result; ++i )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20055 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20056 v20 = (char *)&pActors[ai_array_4F7DB0_actor_ids[i]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20057 v20[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20058 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20059 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20060 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20061 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20062
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20063 //----- (004016FA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20064 int __cdecl BLV_4016FA_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20066 char *v0; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20067 int v1; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20068 int v2; // ebx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20069 unsigned int v3; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20070 int v4; // edx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20071 int v5; // edx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20072 unsigned int v6; // edx@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20073 unsigned int v7; // ST24_4@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20074 int v8; // eax@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20075 int v9; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20076 int v10; // ebx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20077 char v11; // zf@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20078 int v12; // eax@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20079 int v13; // edx@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20080 int v14; // ecx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20081 int v15; // ebx@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20082 unsigned int *v16; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20083 unsigned int v17; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20084 int v18; // ecx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20085 signed int v19; // edi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20086 Actor *v20; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20087 bool v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20088 int v22; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20089 signed int v23; // ebx@36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20090 char *v24; // esi@37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20091 signed int v25; // eax@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20092 int v26; // eax@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20093 int v27; // ebx@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20094 int j; // edi@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20095 unsigned int v29; // eax@46
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20096 int v30; // eax@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20097 int v31; // ecx@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20098 int v32; // eax@51
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20099 signed int v33; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20100 __int64 v34; // qax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20101 char *v35; // ecx@56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20102 int v37; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20103 int v38; // [sp+10h] [bp-14h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20104 int v39; // [sp+14h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20105 int v40; // [sp+18h] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20106 int v41; // [sp+18h] [bp-Ch]@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20107 int i; // [sp+18h] [bp-Ch]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20108 signed int v43; // [sp+1Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20109 signed int v44; // [sp+1Ch] [bp-8h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20110 int v45; // [sp+20h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20112 pParty->uFlags &= 0xFFFFFFCFu;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
20113 v37 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20114 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20115 v43 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20116 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20117 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20118 v0 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20119 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20120 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20121 v0[1] &= 0xFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20122 if ( ! ((Actor *)(v0 - 36))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20123 goto LABEL_60;
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
20124 v39 = abs(pParty->vPosition.z - *((short *)v0 + 55));
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
20125 v38 = abs(pParty->vPosition.y - *((short *)v0 + 54));
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20126 v1 = abs(pParty->vPosition.x - *((short *)v0 + 53));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20127 v2 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20128 v3 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20129 if ( v1 < v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20130 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20131 v4 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20132 v1 = v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20133 v2 = v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20134 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20135 if ( v1 < v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20136 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20137 v5 = v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20138 v1 = v39;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20139 v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20141 if ( v2 < (signed int)v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20142 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20143 v6 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20144 v3 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20145 v2 = v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20146 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20147 v7 = ((unsigned int)(11 * v2) >> 5) + (v3 >> 2) + v1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20148 v8 = *((short *)v0 + 50);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20149 v9 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20150 v40 = v7 - v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20151 if ( v40 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20153 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20154 v40 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20156 if ( v9 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20158 v10 = *(int *)v0 & 0xFEFFFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20159 *(int *)v0 = v10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20160 if ( v10 & 0x80000 || ((Actor *)(v0 - 36))->GetActorsRelation(0) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20161 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20162 v11 = (pParty->uFlags & 0x10) == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20163 *(int *)v0 = v10 | 0x1000000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20164 if ( v11 && (double)v40 < 307.2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20165 pParty->uFlags |= 0x10u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20166 if ( !(pParty->uFlags & 0x20) && v9 < 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20167 pParty->uFlags |= 0x20u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20169 v12 = v45++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20170 ai_array_4F75E0[v12] = v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20171 ai_array_4F7DB0_actor_ids[v12] = v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20173 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20175 LABEL_60:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20176 v0[1] &= 0xBFu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20177 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20178 ++v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20179 v0 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20180 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20181 while ( v43 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20183 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20184 if ( v45 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20185 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20186 v14 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20187 v44 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20188 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20189 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20190 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20191 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20192 v41 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20193 if ( v14 >= v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20194 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20195 v15 = ai_array_4F75E0[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20196 if ( v15 > ai_array_4F75E0[v14] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20197 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20198 v16 = &ai_array_4F7DB0_actor_ids[v14];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20199 v17 = ai_array_4F7DB0_actor_ids[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20200 ai_array_4F7DB0_actor_ids[v13] = *v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20201 *v16 = v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20202 v14 = v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20203 ai_array_4F75E0[v13] = ai_array_4F75E0[v41];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20204 ai_array_4F75E0[v41] = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20206 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20208 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20209 v14 = v44 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20210 v44 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20211 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20212 while ( v14 - 1 < v45 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20214 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20215 v19 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20216 for ( i = 0; v18 < v45; i = v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20217 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20218 v20 = &pActors[ai_array_4F7DB0_actor_ids[v18]];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20219 if ( v20->uAttributes & 0x8000
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20220 || (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
20221 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20222 v22 = ai_array_4F7DB0_actor_ids[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20223 v20->uAttributes |= 0x8000u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20224 ai_array_4F6638_actor_ids[v19] = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20225 ai_array_4F5E68[v19++] = ai_array_4F75E0[v18];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20226 if ( v19 >= 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20227 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20228 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20229 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20231 v23 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20232 ai_arrays_size = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20233 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20234 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20235 v24 = (char *)&pActors[0].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20236 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20237 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20238 if ( ((Actor *)(v24 - 36))->CanAct() && *((short *)v24 + 61) == v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20239 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20240 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20241 if ( v19 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20242 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20243 LABEL_43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20244 v26 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20245 v24[1] |= 0x40u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20246 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20247 ai_array_4F6638_actor_ids[v26] = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20248 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20249 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20250 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20251 while ( ai_array_4F6638_actor_ids[v25] != v23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20252 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20253 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20254 if ( v25 >= v19 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20255 goto LABEL_43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20256 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20257 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20259 ++v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20260 v24 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20261 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20262 while ( v23 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20263 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20264 v27 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20265 for ( j = 0; j < v45; ++j )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20267 v29 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20268 if ( pActors[v29].uAttributes & 0xC000 && pActors[v29].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20269 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20270 v30 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20271 if ( v27 <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20272 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20273 LABEL_51:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20274 v31 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20275 v32 = ai_array_4F7DB0_actor_ids[j];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20276 ++ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20277 ai_array_4F6638_actor_ids[v31] = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20278 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20279 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20280 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20281 while ( ai_array_4F6638_actor_ids[v30] != ai_array_4F7DB0_actor_ids[j] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20282 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20283 ++v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20284 if ( v30 >= v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20285 goto LABEL_51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20286 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20287 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20289 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20290 v33 = ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20291 if ( ai_arrays_size > 30 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20292 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20293 v33 = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20294 ai_arrays_size = 30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20295 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20296 memcpy(ai_array_4F7DB0_actor_ids, ai_array_4F6638_actor_ids, 4 * v33);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20297 memcpy(ai_array_4F75E0, ai_array_4F5E68, 4 * ai_arrays_size);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20298 v34 = (unsigned int)ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20299 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20301 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20302 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20303 v35 = (char *)&pActors[ai_array_4F7DB0_actor_ids[HIDWORD(v34)]].uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20304 v35[1] |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20305 ++HIDWORD(v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20306 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20307 while ( SHIDWORD(v34) < (signed int)v34 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20309 return v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20310 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20311 // 4F75D8: using guessed type int ai_arrays_size;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20313 //----- (00401A91) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20314 void __cdecl sub_401A91_AI()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20315 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20316 unsigned int v0; // esi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20317 int v1; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20318 int v2; // ecx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20319 int v3; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20320 signed int v4; // edi@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20321 char *v5; // esi@12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20322 signed int v6; // eax@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20323 __int16 v7; // cx@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20324 Player **v8; // esi@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20325 Player *pPlayer; // ecx@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20326 Actor *pActor; // esi@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20327 __int16 v11; // ax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20328 unsigned int v12; // eax@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20329 signed int v13; // edi@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20330 SpellBuff *v14; // ebx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20331 unsigned int v15; // edi@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20332 char *v16; // eax@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20333 unsigned int v17; // edx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20334 unsigned int v18; // ecx@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20335 unsigned __int16 v19; // ax@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20336 int *v20; // esi@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20337 Actor *v21; // ebx@80
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20338 unsigned __int16 v22; // ax@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20339 signed int v23; // eax@94
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20340 unsigned int v24; // eax@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20341 signed int v25; // edi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20342 SpellBuff *v26; // esi@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20343 unsigned int v27; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20344 unsigned int v28; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20345 unsigned int v29; // eax@127
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20346 AIDirection *v30; // eax@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20347 unsigned __int16 v31; // ax@132
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20348 unsigned int v32; // esi@142
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20349 int v33; // eax@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20350 int v34; // eax@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20351 char v35; // al@150
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20352 unsigned int v36; // edi@152
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20353 signed int v37; // eax@154
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20354 unsigned __int8 v38; // sf@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20355 unsigned __int8 v39; // of@158
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20356 signed int v40; // edx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20357 unsigned int v41; // ecx@166
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20358 double v42; // st7@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20359 double v43; // st6@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20360 bool v44; // eax@189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20361 bool v45; // eax@192
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20362 unsigned __int8 v46; // cl@197
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20363 double v47; // st7@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20364 double v48; // st7@207
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20365 char v49; // zf@208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20366 char v50; // zf@214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20367 signed int v51; // edx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20368 unsigned int v52; // ecx@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20369 __int16 v53; // fps@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20370 unsigned __int8 v54; // c0@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20371 unsigned __int8 v55; // c3@224
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20372 double v56; // st7@226
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20373 AIDirection *v57; // eax@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20374 double v58; // st7@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20375 signed int v59; // [sp-18h] [bp-C8h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20376 int v60; // [sp-14h] [bp-C4h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20377 int v61; // [sp-14h] [bp-C4h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20378 AIDirection *v62; // [sp-14h] [bp-C4h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20379 signed int v63; // [sp-14h] [bp-C4h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20380 unsigned int v64; // [sp-14h] [bp-C4h]@219
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20381 unsigned int v65; // [sp-10h] [bp-C0h]@144
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20382 char v66; // [sp-10h] [bp-C0h]@147
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20383 AIDirection *v67; // [sp-10h] [bp-C0h]@167
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20384 int v68; // [sp-10h] [bp-C0h]@168
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20385 AIDirection *v69; // [sp-10h] [bp-C0h]@206
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20386 int v70; // [sp-10h] [bp-C0h]@213
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20387 AIDirection *v71; // [sp-10h] [bp-C0h]@216
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20388 AIDirection v72; // [sp+0h] [bp-B0h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20389 AIDirection a3; // [sp+1Ch] [bp-94h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20390 AIDirection v74; // [sp+38h] [bp-78h]@246
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20391 AIDirection v75; // [sp+54h] [bp-5Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20392 int v76; // [sp+70h] [bp-40h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20393 signed int a1; // [sp+74h] [bp-3Ch]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20394 int v78; // [sp+78h] [bp-38h]@79
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20395 AIDirection pDir; // [sp+7Ch] [bp-34h]@129
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20396 float v80; // [sp+98h] [bp-18h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20397 int v81; // [sp+9Ch] [bp-14h]@100
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20398 int v82; // [sp+A0h] [bp-10h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20399 unsigned int uActorID; // [sp+A4h] [bp-Ch]@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20400 unsigned int v84; // [sp+A8h] [bp-8h]@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20401 signed int a2; // [sp+ACh] [bp-4h]@83
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20402
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20403 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20404 ODM_4014E6_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20405 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20406 BLV_4016FA_AI();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20407 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20408 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor && pParty->field_1613C > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20409 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20410 if ( pParty->field_1613C > 417 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20411 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20412 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20413 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20414 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20415 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20416 pParty->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (pParty->sRotationY + rand() % 16 - 8);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20417 v1 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20418 v2 = 128;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20419 v3 = pParty->sRotationX + v1 % 16 - 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20420 pParty->sRotationX = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20421 if ( v3 > 128 || (v2 = -128, v3 < -128) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20422 pParty->sRotationX = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20423 pParty->uFlags |= 2u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20424 pParty->field_1613C -= pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20425 v4 = pParty->field_16140 + 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20426 if ( pParty->field_1613C <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20427 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20428 pParty->field_1613C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20429 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20430 if ( (signed int)uNumActors > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20431 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20432 v5 = (char *)&pActors[0].sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20433 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20435 if ( ((Actor *)(v5 - 40))->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20436 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20437 v6 = stru_50C198.CalcMagicalDamageToActor((Actor *)(v5 - 40), 5, v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20438 v7 = *(short *)v5 - v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20439 *(short *)v5 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20440 if ( v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20441 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20442 if ( v7 >= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20443 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20444 Actor::_4030AD(v84, 4, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20445 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20446 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20447 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20448 Actor::Die(v84);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20449 if ( *((int *)v5 + 19) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20450 sub_4269A2_GivePartyExp(pMonsterStats->pInfos[*((short *)v5 + 28)].uExp);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20451 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20454 ++v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20455 v5 += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20457 while ( (signed int)v84 < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20459 v8 = &pPlayers[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20460 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20462 pPlayer = *v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20463 if ( !(*v8)->pConditions[14] && !pPlayer->pConditions[15] && !pPlayer->pConditions[16] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20464 pPlayer->ReceiveDamage(v4, 5);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20465 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20466 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20467 while ( (signed int)v8 <= (signed int)&pPlayers[4] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20468 v0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20469 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20470 if ( pTurnEngine->field_1C != v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20471 --pTurnEngine->field_1C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20472 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20474 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20475 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20476 pTurnEngine->_405E14();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20477 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20478 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20479 uActorID = v0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20480 if ( (signed int)uNumActors > (signed int)v0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20481 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20482 LODWORD(v80) = (int)(char *)pActors + 176;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20483 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20485 pActor = (Actor *)(LODWORD(v80) - 176);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20486 v11 = *(unsigned int *)LODWORD(v80);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20487 v49 = *(unsigned int *)LODWORD(v80) == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20488 dword_4F6E08[uActorID] = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20489 if ( v49 || v11 == 11 || v11 == 19 || *(char *)(LODWORD(v80) - 139) & 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20490 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20491 if ( !*(short *)(LODWORD(v80) - 136) && v11 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20492 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20493 v84 = *(_QWORD *)(LODWORD(v80) + 84) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20494 v82 = *(_QWORD *)(LODWORD(v80) + 52) <= 0i64 ? 0 : 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20495 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20496 v13 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20497 v14 = (SpellBuff *)(LODWORD(v80) + 36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20498 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20499 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20500 if ( v13 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20502 v14->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20503 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20505 ++v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20506 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20507 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20508 while ( v13 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20509 if ( v84 != v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20510 && SHIDWORD(pActor->pActorBuffs[3].uExpireTime) <= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20511 && (SHIDWORD(pActor->pActorBuffs[3].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20512 || LODWORD(pActor->pActorBuffs[3].uExpireTime) <= v12) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20513 pActor->uActorHeight = pMonsterList->pMonsters[pActor->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20514 if ( v82 != v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20515 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20516 pActor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20517 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) <= (signed int)v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20519 if ( SHIDWORD(pActor->pActorBuffs[1].uExpireTime) < (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20520 || LODWORD(pActor->pActorBuffs[1].uExpireTime) <= v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20521 pActor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].uHostilityType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20524 if ( SHIDWORD(pActor->pActorBuffs[5].uExpireTime) > (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20525 || SHIDWORD(pActor->pActorBuffs[5].uExpireTime) >= (signed int)v12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20526 && LODWORD(pActor->pActorBuffs[5].uExpireTime)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20527 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) > 0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20528 || SHIDWORD(pActor->pActorBuffs[6].uExpireTime) >= 0 && LODWORD(pActor->pActorBuffs[6].uExpireTime) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20529 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20530 v15 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20531 v16 = (char *)&pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20532 pActor->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20533 v17 = pActor->uCurrentActionTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20534 v18 = pActor->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20535 if ( (signed int)v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20536 *(int *)v16 = v18 - v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20537 if ( *(int *)v16 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20538 *(int *)v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20539 if ( (signed int)v17 < pActor->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20540 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20541 v19 = pActor->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20542 if ( v19 == Dying )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20543 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20544 pActor->uAIState = Dead;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20546 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20548 if ( v19 != 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20550 Actor::_403F58(uActorID, Dying, 256, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20551 goto LABEL_78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20552 }
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
20553 pActor->uAIState = Standing;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20554 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20555 pActor->uCurrentActionTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20556 pActor->uCurrentActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20557 pActor->UpdateAnimation();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20558 LABEL_78:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20559 ++uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20560 LODWORD(v80) += 836;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20561 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20562 while ( (signed int)uActorID < (signed int)uNumActors );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20564 v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20565 if ( ai_arrays_size > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20566 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20567 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20568 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20569 uActorID = ai_array_4F7DB0_actor_ids[v78];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20570 v20 = &dword_4F6E08[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20571 v21 = &pActors[uActorID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20572 Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20573 if ( v21->pMonsterInfo.uHostilityType && !*v20 )
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20574 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20575 a2 = *v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20576 v76 = a2 & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20577 if ( (a2 & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20578 v80 = 0.5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20579 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20580 v80 = 1.0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20581 v22 = v21->uAIState;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20582 if ( v22 == 4 || v22 == 5 || v22 == 11 || v22 == 19 || v22 == 17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20583 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20584 if ( !v21->sCurrentHP )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20585 Actor::Die(uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20586 if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20587 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20588 v84 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20589 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20590 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20591 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20592 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20593 v23 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20594 v84 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20595 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20596 if ( (signed __int64)v21->pActorBuffs[1].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20597 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20598 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20599 v82 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20600 if ( (signed __int64)v21->pActorBuffs[2].uExpireTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20601 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20602 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20603 v81 = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20604 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20605 v25 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20606 v26 = v21->pActorBuffs;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20607 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20608 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20609 if ( v25 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20611 v26->_4585CA(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20612 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20613 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20614 ++v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20615 ++v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20616 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20617 while ( v25 < 22 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20618 if ( v84 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20619 && SHIDWORD(v21->pActorBuffs[3].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20620 && (SHIDWORD(v21->pActorBuffs[3].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20621 || LODWORD(v21->pActorBuffs[3].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20622 v21->uActorHeight = pMonsterList->pMonsters[v21->pMonsterInfo.uID - 1].uMonsterHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20623 if ( v82 != v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20624 {
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20625 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20626 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) <= (signed int)v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20627 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20628 if ( SHIDWORD(v21->pActorBuffs[1].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20629 || LODWORD(v21->pActorBuffs[1].uExpireTime) <= v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20630 v21->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[v21->pMonsterInfo.uID].uHostilityType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20631 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20633 if ( v81 != v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20634 && SHIDWORD(v21->pActorBuffs[2].uExpireTime) <= (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20635 && (SHIDWORD(v21->pActorBuffs[2].uExpireTime) < (signed int)v24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20636 || LODWORD(v21->pActorBuffs[2].uExpireTime) <= v24) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20637 {
45
bcc051713d20 BLV render & seffects
Nomad
parents: 31
diff changeset
20638 v21->uAIState = Removed;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20639 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20640 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20641 if ( v21->pActorBuffs[5].uExpireTime || v21->pActorBuffs[6].uExpireTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20642 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20643 v27 = pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20644 v28 = v21->pMonsterInfo.uRecoveryTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20645 v21->uCurrentActionTime += pMiscTimer->uTimeElapsed;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20646 if ( (signed int)v28 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20647 v21->pMonsterInfo.uRecoveryTime = v28 - v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20648 if ( (v21->pMonsterInfo.uRecoveryTime & 0x80000000u) != 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20649 v21->pMonsterInfo.uRecoveryTime = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20650 v29 = v21->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20651 if ( !(v29 & 0x8000) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20652 v21->uAttributes = v29 | 0x8000;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20653 a1 = 8 * uActorID | 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20654 v30 = Actor::GetDirectionInfo(8 * uActorID | 3, a2, &a3, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20655 v49 = v21->pMonsterInfo.uHostilityType == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20656 memcpy(&v75, v30, sizeof(v75));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20657 memcpy(&pDir, &v75, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20658 if ( !v49 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20660 if ( v80 * 307.2 >= (double)(signed int)v75.uDistance
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20661 && ((v31 = v21->uAIState, v31 == 6) || !v31 || v31 == 1 || v31 == 9)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20662 || v21->pMonsterInfo.uMissleAttack1Type && v21->uAIState == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20664 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20665 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20667 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20668 if ( (signed int)v21->uCurrentActionTime < v21->uCurrentActionLength )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20669 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20670 if ( v21->uAIState == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20672 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20673 v35 = stru_50C198.special_ability_use_check(v21, uActorID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20674 stru_50FE08.Add(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20675 a1,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20676 5120,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20677 v21->vPosition.x,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20678 v21->vPosition.y,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20679 v21->vPosition.z + ((signed int)v21->uActorHeight >> 1),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20680 v35,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20681 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20682 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20684 if ( v21->uAIState == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20686 v34 = v21->pMonsterInfo.uMissleAttack1Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20687 v66 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20688 goto LABEL_149;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20689 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20690 if ( v21->uAIState == 12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20691 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20692 v34 = v21->pMonsterInfo.uMissleAttack2Type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20693 v66 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20694 LABEL_149:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20695 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20696 Actor::_404874(uActorID, &pDir, v34, v66);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20697 goto LABEL_152;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20699 v32 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20700 if ( v21->uAIState == 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20701 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20702 if ( v21->uAIState == 18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20703 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20704 v65 = v21->pMonsterInfo.uSpellSkillAndMastery2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20705 v60 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20706 v33 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20707 LABEL_146:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20708 Actor::_404AC7(uActorID, &pDir, v33, v60, v65);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20710 LABEL_152:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20711 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20712 if ( v21->pMonsterInfo.uHostilityType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20713 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20714 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20716 v36 = v75.uDistance;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20717 v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (v21->pMonsterInfo.uID - 1) / 3]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20718 + (pActors[a2 >> 3].pMonsterInfo.uID - 1) / 3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20719 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20720 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20721 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20722 v37 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20724 if ( v37 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20725 goto LABEL_257;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20726 if ( v37 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20727 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20728 v39 = __OFSUB__(v36, 1024);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20729 v38 = ((v36 - 1024) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20731 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20732 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20733 if ( v37 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20735 v39 = __OFSUB__(v36, 2560);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20736 v38 = ((v36 - 2560) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20738 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20739 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20740 if ( v37 != 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20741 goto LABEL_165;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20742 v39 = __OFSUB__(v36, 5120);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20743 v38 = ((v36 - 5120) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20744 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20745 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20746 if ( v38 ^ v39 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20747 LABEL_257:
29
e62134245ab0 On BLV loading.
Nomad
parents: 28
diff changeset
20748 v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20749 LABEL_165:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20750 if ( (signed __int64)v21->pActorBuffs[4].uExpireTime > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20751 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20752 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20753 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20754 if ( (signed int)v36 >= 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20756 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20757 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20758 goto LABEL_253;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20759 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20760 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20761 goto LABEL_182;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20763 if ( v21->pMonsterInfo.uHostilityType != 4 || !a2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20764 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20765 if ( !(v21->uAttributes & 0x020000) || v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20767 if ( v21->pMonsterInfo.uAIType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20768 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20769 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20770 if ( v21->pMonsterInfo.uMovementType != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20771 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20772 Actor::_403EB6(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20773 v32,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20774 a2,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20775 (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333),
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20776 &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20778 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20780 if ( v21->pMonsterInfo.uAIType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20782 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20783 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20784 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.2;
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 if ( v21->pMonsterInfo.uAIType != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20789 goto LABEL_185;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20790 v84 = v21->sCurrentHP;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20791 v42 = (double)(signed int)v84;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20792 v43 = (double)(signed int)v21->pMonsterInfo.uHP * 0.1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20793 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20794 if ( v43 > v42 && (signed int)v36 < 10240 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20796 v67 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20797 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20798 v40 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20799 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20800 LABEL_182:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20801 Actor::_402968(v41, v40, 0, v67);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20802 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20803 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20805 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20806 LABEL_185:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20807 v81 = v36 - v21->uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20808 if ( v76 == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20809 v81 -= pActors[a2 >> 3].uActorRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20810 if ( v81 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20811 v81 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20812 rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20813 v44 = (signed int)v21->pMonsterInfo.uRecoveryTime <= 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20814 v21->uAttributes &= 0xFBFFFF;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20815 v82 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20816 v49 = v21->pMonsterInfo.uMovementType == 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20817 v84 = v44;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20818 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20819 v82 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20820 if ( v81 >= 5120 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20821 goto LABEL_241;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20822 v45 = stru_50C198.special_ability_use_check(v21, v32);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20823 if ( !v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20824 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20825 if ( v21->pMonsterInfo.uMissleAttack1Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20827 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20828 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20829 Actor::_403476(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20830 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20831 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20832 LABEL_223:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20833 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20834 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20835 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20836 //UNDEF(v53);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20837 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20838 if ( !(v54 | v55) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20839 goto LABEL_219;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20840 LABEL_225:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20841 Actor::_402AD7(v32, a2, v32, (signed __int64)v47, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20842 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20844 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20845 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20847 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20848 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20849 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20850 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20851 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20852 v63 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20853 goto LABEL_240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20855 goto LABEL_235;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20856 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20857 goto LABEL_227;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20859 if ( v45 != 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20860 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20861 if ( v45 > 1 && v45 <= 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20862 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20863 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20864 v46 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20865 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20866 v46 = v21->pMonsterInfo.uSpell2ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20867 if ( v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20868 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20869 if ( v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20870 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20871 if ( v45 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20872 Actor::_403854(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20873 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20874 Actor::_403A60(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20875 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20876 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20877 if ( v80 * 307.2 > (double)v81 || v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20878 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20879 LABEL_217:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20880 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20881 LABEL_218:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20882 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20883 LABEL_219:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20884 v51 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20885 v64 = (signed __int64)v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20886 v52 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20887 LABEL_247:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20888 Actor::_403EB6(v52, v51, v64, v69);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20889 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20890 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20891 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20892 v47 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20893 goto LABEL_225;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20894 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20895 v48 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20896 if ( (double)v81 >= v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20898 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20899 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20900 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20901 LABEL_215:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20902 if ( !v50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20903 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20904 v71 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20905 v63 = 256;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20906 LABEL_240:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20907 Actor::_402686(v32, a2, v63, v71);
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 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20911 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20912 v70 = (signed __int64)v48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20913 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20914 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20915 goto LABEL_237;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20916 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20917 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20918 goto LABEL_209;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20919 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20920 LABEL_241:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20921 if ( !v21->pMonsterInfo.uMovementType )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20922 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20923 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20924 v61 = 1024;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20925 LABEL_252:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20926 v41 = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20927 v40 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20928 LABEL_253:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20929 Actor::_4032B2(v41, v40, v61, v68);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20930 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20931 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20932 if ( v21->pMonsterInfo.uMovementType == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20933 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20934 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20935 v61 = 2560;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20936 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20937 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20938 if ( v21->pMonsterInfo.uMovementType == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20940 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20941 v61 = 5120;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20942 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20943 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20944 if ( v21->pMonsterInfo.uMovementType == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20945 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20946 v68 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20947 v61 = 10240;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20948 goto LABEL_252;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20949 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20950 if ( v21->pMonsterInfo.uMovementType == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20951 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20952 v57 = Actor::GetDirectionInfo(a1, 4u, &v72, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20953 v58 = (double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20954 memcpy(&v74, v57, sizeof(v74));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20955 memcpy(&pDir, &v74, sizeof(pDir));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20956 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20957 v52 = uActorID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20958 v64 = (signed __int64)v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20959 v51 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20960 goto LABEL_247;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20961 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20962 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20963 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20964 if ( !v21->pMonsterInfo.uMissleAttack2Type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20965 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20966 v56 = v80 * 307.2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20967 if ( (double)v81 >= v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20968 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20969 if ( v81 >= 1024 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20970 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20971 v50 = v82 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20972 goto LABEL_215;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20973 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20974 LABEL_235:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20975 if ( v82 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20976 goto LABEL_217;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20977 v70 = (signed __int64)v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20978 v62 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20979 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20980 LABEL_237:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20981 Actor::_40281C(v32, a2, v59, v62, v70);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20982 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20983 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20984 LABEL_227:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20985 v49 = v84 == 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20986 LABEL_209:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20987 v69 = &pDir;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20988 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20989 goto LABEL_218;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20990 Actor::_403C6C(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20991 goto LABEL_254;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20993 if ( !v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20994 goto LABEL_223;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20995 Actor::_40368B(v32, a2, &pDir);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20996 LABEL_254:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20997 ++v78;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20998 if ( v78 >= ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20999 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21001 v65 = v21->pMonsterInfo.uSpellSkillAndMastery1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21002 v60 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21003 v33 = v21->pMonsterInfo.uSpell1ID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21004 goto LABEL_146;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21005 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21006 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21007
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21008
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21009
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21010
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21011 //----- (0040261D) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21012 int stru298::Add(__int16 uID, __int16 a3, __int16 x, __int16 y, __int16 z, char a7, char a8)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21013 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21014 int result; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21015
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21016 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21017 if ( this->count < 100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21019 this->pIDs[result] = uID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21020 this->pXs[this->count] = x;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21021 this->pYs[this->count] = y;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21022 this->pZs[this->count] = z;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21023 this->field_324[this->count] = a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21024 this->field_3EC[this->count] = a8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21025 result = this->count;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21026 this->field_450[this->count++] = a7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21027 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21028 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21029 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21030
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21031
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21032
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21033
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21034
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21035 //----- (00402CAE) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21036 int stru193_math::SinCos(int angle)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21037 {
58
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21038 int v2; // eax@1
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21039
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21040 //a2: (angle - uIntegerHalfPi) for sin(angle)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21041 // (angle) for cos(angle)
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21042
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21043 v2 = uDoublePiMask & angle;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21044
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21045 if ( v2 > uIntegerPi )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21046 v2 = uIntegerDoublePi - v2;
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21047 if ( v2 >= uIntegerHalfPi )
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21048 return -pCosTable[uIntegerPi - v2];
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21049 else
41cbaabde2cb BLV render
Nomad
parents: 53
diff changeset
21050 return pCosTable[v2];
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21052
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21053
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21054
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21055
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21056
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21057
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21058
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21059
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21060
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21061
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21062
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21063
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21064
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21065
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21066 //----- (00404544) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21067 signed int stru262_TurnBased::_404544()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21068 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21069 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21070 TurnBased_QueueElem *v2; // esi@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21071 Actor *v3; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21072 Actor *v4; // ecx@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21073 Player *v5; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21074 int v6; // ecx@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21075 TurnBased_QueueElem *v7; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21076 TurnBased_QueueElem *v8; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21077 int v9; // edx@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21078 int v10; // esi@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21079 int v11; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21080 int v12; // ST0C_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21081 int v13; // ST10_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21082 int v14; // ST14_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21083 int v15; // ST18_4@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21084 signed int result; // eax@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21085 TurnBased_QueueElem *v17; // edi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21086 int v18; // [sp+20h] [bp-Ch]@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21087 int v19; // [sp+24h] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21088 int v20; // [sp+28h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21089 signed int v21; // [sp+28h] [bp-4h]@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21090 int v22; // [sp+28h] [bp-4h]@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21091
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21092 v20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21093 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21094 v19 = this->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21095 if ( this->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21096 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21097 v2 = this->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21098 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21099 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21100 if ( (v2->uPackedID & 7) == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21101 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21102 v3 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21103 v4 = &pActors[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21104 LOBYTE(v4->uAttributes) |= 0x80u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21105 if ( !v4->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21106 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21107 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21108 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21109 LOBYTE(v3->uAttributes) &= 0x7Fu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21110 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21112 if ( (v2->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21113 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21114 v5 = &pParty->pPlayers[v2->uPackedID >> 3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21115 if ( v5->pConditions[14]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21116 || v5->pConditions[16]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21117 || v5->pConditions[15]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21118 || v5->pConditions[13]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21119 || v5->pConditions[12]
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21120 || v5->pConditions[2] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21122 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21123 v2->field_4 = 1001;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21124 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21126 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21127 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21128 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21129 while ( v20 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21131 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21132 if ( v6 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21134 v21 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21135 v7 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21136 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21137 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21138 v18 = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21139 if ( v21 < v6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21140 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21141 v8 = v7 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21142 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21143 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21144 v9 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21145 v10 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21146 if ( v9 < v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21147 || v9 == v10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21148 && ((v11 = v8->uPackedID & 7, v11 == 4) && (v7->uPackedID & 7) == 3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21149 || v11 == (v7->uPackedID & 7) && (v8->uPackedID & 0xFFFFFFF8) < (v7->uPackedID & 0xFFFFFFF8)) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21151 v12 = v7->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21152 v13 = v7->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21153 v14 = v7->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21154 v15 = v7->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21155 v7->uPackedID = v8->uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21156 v7->field_4 = v8->field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21157 v7->uActionLength = v8->uActionLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21158 v7->field_C = v8->field_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21159 v8->uPackedID = v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21160 v8->field_4 = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21161 v8->uActionLength = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21162 v8->field_C = v15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21163 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21164 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21165 ++v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21167 while ( v18 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21169 ++v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21170 v6 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21171 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21173 while ( v21 - 1 < v6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21174 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21175 v1->uActorQueueSize = v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21176 result = v1->pQueue[0].uPackedID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21177 if ( (v1->pQueue[0].uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21178 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21179 result = (result >> 3) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21180 uActiveCharacter = result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21181 v1->field_18 |= 4u;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21182 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21183 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21185 uActiveCharacter = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21186 v1->field_18 &= 0xFFFFFFFBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21187 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21188 v22 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21189 if ( v1->uActorQueueSize > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21190 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21191 v17 = v1->pQueue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21192 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21193 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21194 if ( (v17->uPackedID & 7) == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21195 pParty->pPlayers[v17->uPackedID >> 3].uTimeToRecovery = (signed __int64)((double)v17->field_4 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21196 ++v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21197 ++v17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21198 result = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21200 while ( v22 < v1->uActorQueueSize );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21202 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21204
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21205 //----- (0040471C) --------------------------------------------------------
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
21206 void stru262_TurnBased::_40471C()
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
21207 {
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21208 if ( pParty->bTurnBasedModeOn == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21209 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21210 if ( pTurnEngine->field_4 == 2 )
59
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
21211 _406457(0);
5159d2e6f559 BLV render
Nomad
parents: 58
diff changeset
21212 }
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21213 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21214
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21215
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21216 //----- (00404828) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21217 LayingItem::LayingItem()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21219 LayingItem *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21220
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21221 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21222 v1->field_22 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21223 v1->uSoundID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21224 v1->uFacing = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21225 v1->vVelocity.z = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21226 v1->vVelocity.y = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21227 v1->vVelocity.x = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21228 v1->uItemType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21229 v1->uObjectDescID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21230 v1->field_61 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21231 v1->field_60_distance_related_prolly_lod = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21232 v1->field_20 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21233 v1->uSpriteFrameID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21234 v1->field_50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21235 v1->field_4C = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21236 v1->field_48 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21237 v1->field_54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21238 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21239
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21240
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21242 //----- (004059DB) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21243 signed int stru262_TurnBased::Start()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21245 stru262_TurnBased *v1; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21246 unsigned int v2; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21247 int v3; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21248 int v4; // eax@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21249 unsigned int v5; // esi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21250 Actor *v6; // edi@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21251 unsigned int v7; // eax@9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21252 unsigned int v8; // edx@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21253 unsigned __int8 v9; // zf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21254 unsigned __int8 v10; // sf@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21255 unsigned __int8 v11; // of@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21256 char *v12; // esi@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21257 int v13; // ecx@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21258 unsigned __int16 v14; // ax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21259 int v15; // ecx@18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21260 signed __int64 v16; // qax@19
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21261 int v17; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21262 unsigned int v18; // esi@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21263 char *v19; // esi@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21264 int v20; // edx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21265 char *v21; // eax@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21266 int v22; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21267 int v23; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21268 char *v24; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21269 char *v25; // ecx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21270 int v26; // edx@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21271 int v27; // eax@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21272 int v28; // ecx@38
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21273 AIDirection v30; // [sp+Ch] [bp-68h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21274 AIDirection v31; // [sp+28h] [bp-4Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21275 AIDirection a3; // [sp+44h] [bp-30h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21276 int v33; // [sp+60h] [bp-14h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21277 int *v34; // [sp+64h] [bp-10h]@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21278 int v35; // [sp+68h] [bp-Ch]@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21279 int v40; // [sp+6Ch] [bp-8h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21280 unsigned int v37; // [sp+70h] [bp-4h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21281
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21282 pTurnEngine->field_18 &= 0xFFFFFFFDu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21283 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21284 pEventTimer->TrackGameTime();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21285 pAudioPlayer->StopChannels(-1, -1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21286 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21287 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21288 v40 = (int)pParty->pPlayers;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21289 dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21290 dword_50C994 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21291 v1->field_10 = 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21292 v1->field_0 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21293 v1->field_8 = 64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21294 v1->field_4 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21295 v1->uActorQueueSize = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21296 v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21297 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21298 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21299 if ( ((Player *)v40)->CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21300 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21301 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = 8 * v3 | OBJECT_Player;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21302 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21303 v1->pQueue[v1->uActorQueueSize].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21304 pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21305 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21306 v40 += 6972;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21307 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21308 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21309 while ( v40 < (signed int)pParty->pHirelings );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21310 v35 = v1->uActorQueueSize;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21311 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21312 v40 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21313 if ( v40 < v40 + ai_arrays_size )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21314 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21315 v34 = (int *)ai_array_4F7DB0_actor_ids;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21316 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21317 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21318 v37 = *v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21319 v5 = v37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21320 v6 = &pActors[v37];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21321 if ( v37 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21322 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21323 if ( pActors[v37].CanAct() )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21324 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21325 v7 = v6->uAttributes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21326 if ( v7 & 0x8000 < 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21327 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21328 v8 = dword_4F6E08[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21329 LOBYTE(v7) = v7 | 0x80;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21330 v6->uAttributes = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21331 v33 = 8 * v5 | OBJECT_Actor;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21332 memcpy(&v31, Actor::GetDirectionInfo(8 * v5 | OBJECT_Actor, v8, &a3, 0), sizeof(v31));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21333 memcpy(&v30, &v31, sizeof(v30));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21334 Actor::_403F58(v37, 4, 32, &v30);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21335 *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21336 v1->pQueue[v1->uActorQueueSize].field_C = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21337 v1->pQueue[v1->uActorQueueSize++].uActionLength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21338 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21339 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21340 v4 = v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21341 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21342 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21343 ++v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21344 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21345 while ( v40 < v4 + ai_arrays_size );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21346 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21347 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21348 v11 = __OFSUB__(v1->uActorQueueSize, v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21349 v9 = v1->uActorQueueSize == v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21350 v10 = ((v1->uActorQueueSize - v2) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21351 v37 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21352 v40 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21353 if ( !((unsigned __int8)(v10 ^ v11) | v9) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21354 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21355 v12 = (char *)&v1->pQueue[0].field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21356 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21357 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21358 v13 = *((int *)v12 - 1) & 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21359 if ( v13 != OBJECT_Player )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21360 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21361 v14 = pPlayers[(*((int *)v12 - 1) >> 3) + 1]->uTimeToRecovery;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21362 if ( v14 != (short)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21363 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21364 v33 = v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21365 v16 = (signed __int64)((double)v14 * 0.46875);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21366 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21367 *(int *)v12 = v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21368 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21369 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21370 v15 = v37++;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21371 *(&a3.uDistance + v15) = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21372 LABEL_26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21373 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21374 v12 += 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21375 if ( v40 >= v1->uActorQueueSize )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21376 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21377 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21378 if ( v13 != 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21379 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21380 *(int *)v12 = 666;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21381 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21382 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21383 v17 = rand() % 99;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21384 if ( v17 < 33 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21386 *(int *)v12 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21387 goto LABEL_26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21388 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21389 LODWORD(v16) = SHIDWORD(v16) < 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21390 LOBYTE(v16) = SHIDWORD(v16) >= 66;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21391 LODWORD(v16) = 2 * v16 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21392 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21393 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21394 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21395 v18 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21396 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21397 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21398 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21399 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21400 *(&v31.uDistance + v18) = pParty->pPlayers[*(&v1->field_0 + 4 * (*(&a3.uDistance + v18) + 2)) >> 3].GetAttackRecoveryTime(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21401 v2);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21402 ++v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21403 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21404 while ( (signed int)v18 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21405 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21407 v35 = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21408 v34 = (int *)1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21409 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21410 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21411 v40 = (int)v34;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21412 if ( (signed int)v34 < (signed int)v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21413 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21414 v19 = (char *)&v31.uDistance + v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21415 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21416 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21417 v20 = *(int *)v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21418 v33 = 4 * v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21419 v21 = (char *)(&v31.uDistance + v40);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21420 v22 = *(int *)v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21421 if ( *(int *)v21 < v20 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21422 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21423 *(int *)v21 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21424 v23 = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21425 *(int *)v19 = v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21426 v24 = (char *)&a3.uDistance + v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21427 v25 = (char *)&a3.uDistance + v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21428 v26 = *(int *)v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21429 *(int *)v24 = *(unsigned int *)((char *)&a3.uDistance + v35);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21430 *(int *)v25 = v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21431 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21432 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21433 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21434 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21435 while ( v40 < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21436 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21437 v34 = (int *)((char *)v34 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21438 v35 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21439 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21440 while ( (signed int)((char *)v34 - 1) < (signed int)v37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21441 if ( (signed int)v37 > (signed int)v2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21442 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21443 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21445 v27 = v2 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21446 v28 = *(&a3.uDistance + v2++);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21447 v11 = __OFSUB__(v2, v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21448 v10 = ((v2 - v37) & 0x80000000u) != 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21449 v1->pQueue[v28].field_4 = v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21450 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21451 while ( v10 ^ v11 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21453 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21454 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21455 return v1->_404544();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21456 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21457